From 3b1c806dc8a86792017ce79a8bd30685ffb4d344 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Mon, 30 Apr 2012 14:44:44 +0400 Subject: [PATCH] IDEA-85462 Mercurial: log files are polluted with mercurial logs Never log.info for silent commands. log.debug everything the command and the output. --- .../org/zmlx/hg4idea/execution/HgCommandExecutor.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java index 1bdd028d9d93..44a186947467 100644 --- a/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java +++ b/plugins/hg4idea/src/org/zmlx/hg4idea/execution/HgCommandExecutor.java @@ -189,22 +189,31 @@ public final class HgCommandExecutor { final String cmdString = String.format("%s %s %s", executable, operation, arguments == null ? "" : StringUtils.join(arguments, " ")); // log command - LOG.info(cmdString); if (!myIsSilent) { + LOG.info(cmdString); myVcs.showMessageInConsole(cmdString, ConsoleViewContentType.NORMAL_OUTPUT.getAttributes()); } + else { + LOG.debug(cmdString); + } // log output if needed 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()); + } } private void showError(Exception e) {