From 1d837a835c04078ec66325e9fb9de21ac401874e Mon Sep 17 00:00:00 2001 From: Alexander Alexeev Date: Wed, 30 Nov 2016 15:10:15 +0700 Subject: prevent string concatenation for disabled loggers --- .../src/main/java/com/juick/components/Crosspost.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'juick-crosspost/src/main/java') 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; } -- cgit v1.2.3