diff options
author | Alexander Alexeev | 2016-11-30 15:10:15 +0700 |
---|---|---|
committer | Alexander Alexeev | 2016-11-30 15:10:15 +0700 |
commit | 1d837a835c04078ec66325e9fb9de21ac401874e (patch) | |
tree | 428217d2c617b9caf2eb6d42a7716789881d0937 /juick-crosspost | |
parent | b45c000ed478f2407288aab1532425288f998689 (diff) |
prevent string concatenation for disabled loggers
Diffstat (limited to 'juick-crosspost')
-rw-r--r-- | juick-crosspost/src/main/java/com/juick/components/Crosspost.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/juick-crosspost/src/main/java/com/juick/components/Crosspost.java b/juick-crosspost/src/main/java/com/juick/components/Crosspost.java index fb6dd7d5..c39898f2 100644 --- a/juick-crosspost/src/main/java/com/juick/components/Crosspost.java +++ b/juick-crosspost/src/main/java/com/juick/components/Crosspost.java @@ -128,7 +128,7 @@ public class Crosspost implements AutoCloseable { return false; } - logger.info("FB: #" + jmsg.getMid()); + logger.info("FB: #{}", jmsg.getMid()); String status = getMessageHashTags(jmsg) + "\n" + jmsg.getText(); @@ -159,7 +159,7 @@ public class Crosspost implements AutoCloseable { conn.disconnect(); } catch (Exception e) { - logger.error("fbPost: " + e.getMessage(), e); + logger.error("fbPost exception", e); } return ret; } @@ -170,7 +170,7 @@ public class Crosspost implements AutoCloseable { return false; } - logger.info("VK: #" + jmsg.getMid()); + logger.info("VK: #", jmsg.getMid()); String status = getMessageHashTags(jmsg) + "\n" + jmsg.getText() + "\nhttp://juick.com/" + jmsg.getMid(); @@ -196,7 +196,7 @@ public class Crosspost implements AutoCloseable { conn.disconnect(); } catch (Exception e) { - logger.error("vkPost: " + e.getMessage(), e); + logger.error("vkPost exception", e); } return ret; } @@ -209,7 +209,7 @@ public class Crosspost implements AutoCloseable { String token = percentEncode(tokens.getLeft()); String token_secret = percentEncode(tokens.getRight()); - logger.info("TWITTER: #" + jmsg.getMid()); + logger.info("TWITTER: #{}", jmsg.getMid()); String status = getMessageHashTags(jmsg) + jmsg.getText(); if (status.length() > 115) { @@ -251,7 +251,7 @@ public class Crosspost implements AutoCloseable { conn.disconnect(); } catch (Exception e) { - logger.error("twitterPost: " + e.getMessage(), e); + logger.error("twitterPost exception", e); } return ret; } @@ -277,7 +277,7 @@ public class Crosspost implements AutoCloseable { return Base64.encodeBase64String(rawHmac); } catch (Exception e) { - logger.error("twitterSignature: " + e.getMessage(), e); + logger.error("twitterSignature exception", e); } return null; } |