-
Notifications
You must be signed in to change notification settings - Fork 4.8k
[DRAFT] HIVE-29173: Replace string concatenation in log messages with logging format #6053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,7 @@ default Table loadHmsTable() throws TException, InterruptedException { | |
try { | ||
return metaClients().run(client -> client.getTable(database(), table())); | ||
} catch (NoSuchObjectException nte) { | ||
LOG.trace("Table not found {}", database() + "." + table(), nte); | ||
LOG.trace("Table not found {}.{}", database(), table(), nte); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two placeholders but three arguments. |
||
return null; | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,11 +104,10 @@ public static void importCredentialsFromCurrentSubject(KuduClient client) { | |
// 'client'. This is necessary if we want to support a job which | ||
// reads from one cluster and writes to another. | ||
if (!tok.getService().equals(service)) { | ||
LOG.debug("Not importing credentials for service " + service + | ||
"(expecting service " + service + ")"); | ||
LOG.debug("Not importing credentials for service {} (expecting service {})", service, service); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Passing the same object two times does not make much sense but I guess outside the scope of the PR. |
||
continue; | ||
} | ||
LOG.debug("Importing credentials for service " + service); | ||
LOG.debug("Importing credentials for service {}", service); | ||
client.importAuthenticationCredentials(tok.getPassword()); | ||
return; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,7 +77,7 @@ public synchronized void close() throws IOException { | |
try { | ||
din.close(); | ||
} catch (Exception err) { | ||
LOG.error("Error closing input stream:" + err.getMessage(), err); | ||
LOG.error("Error closing input stream: {}", err.getMessage(), err); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about something simpler: LOG.error("Error closing input stream:", err); |
||
caughtException = err; | ||
} | ||
// Don't close the socket - the stream already does that if needed. | ||
|
@@ -86,7 +86,7 @@ public synchronized void close() throws IOException { | |
try { | ||
client.close(); | ||
} catch (Exception err) { | ||
LOG.error("Error closing client:" + err.getMessage(), err); | ||
LOG.error("Error closing client: {}", err.getMessage(), err); | ||
caughtException = (caughtException == null ? err : caughtException); | ||
} | ||
} | ||
|
@@ -246,7 +246,7 @@ public void handleEvent(ReaderEvent event) { | |
} | ||
// Reader is using a blocking socket .. interrupt it. | ||
if (LOG.isDebugEnabled()) { | ||
LOG.debug("Interrupting reader thread due to reader event with error " + event.getMessage()); | ||
LOG.debug("Interrupting reader thread due to reader event with error {}", event.getMessage()); | ||
} | ||
readerThread.interrupt(); | ||
try { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,12 +144,11 @@ public FixedServiceInstance(String host) { | |
if (NetUtils.isLocalAddress(inetAddress)) { | ||
InetSocketAddress socketAddress = new InetSocketAddress(0); | ||
socketAddress = NetUtils.getConnectAddress(socketAddress); | ||
LOG.info("Adding host identified as local: " + host + " as " | ||
+ socketAddress.getHostName()); | ||
LOG.info("Adding host identified as local: {} as {}", host, socketAddress.getHostName()); | ||
host = socketAddress.getHostName(); | ||
} | ||
} catch (UnknownHostException e) { | ||
LOG.warn("Ignoring resolution issues for host: " + host, e); | ||
LOG.warn("Ignoring resolution issues for host: {}", host, e); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One placeholder, two arguments. |
||
} | ||
} | ||
this.host = host; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if the exception serialization remains the same after this change since we no longer use the API that accepts a
Throwable
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition it is strange that we use two placeholders
{}
but we pass three arguments.