From 167deec25439cbdf94e422b2e39b3085e20885ac Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Thu, 10 May 2012 18:53:48 +0400 Subject: [PATCH] hg cosmetics: don't log empty messages --- .../hg4idea/execution/HgCommandExecutor.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java index 44a186947467..8898bf29f215 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java @@ -198,21 +198,25 @@ public final class HgCommandExecutor { } // log output if needed - if (!myIsSilent && myShowOutput) { - LOG.info(result.getRawOutput()); - myVcs.showMessageInConsole(result.getRawOutput(), ConsoleViewContentType.SYSTEM_OUTPUT.getAttributes()); - } - else { - LOG.debug(result.getRawOutput()); + if (!result.getRawOutput().isEmpty()) { + if (!myIsSilent && myShowOutput) { + LOG.info(result.getRawOutput()); + myVcs.showMessageInConsole(result.getRawOutput(), ConsoleViewContentType.SYSTEM_OUTPUT.getAttributes()); + } + else { + LOG.debug(result.getRawOutput()); + } } // log error - if (!myIsSilent) { - LOG.info(result.getRawError()); - myVcs.showMessageInConsole(result.getRawError(), ConsoleViewContentType.ERROR_OUTPUT.getAttributes()); - } - else { - LOG.debug(result.getRawError()); + if (!result.getRawError().isEmpty()) { + if (!myIsSilent) { + LOG.info(result.getRawError()); + myVcs.showMessageInConsole(result.getRawError(), ConsoleViewContentType.ERROR_OUTPUT.getAttributes()); + } + else { + LOG.debug(result.getRawError()); + } } }