IDEA-85462 Mercurial: log files are polluted with mercurial logs

Never log.info for silent commands.
log.debug everything the command and the output.
This commit is contained in:
Kirill Likhodedov
2012-04-30 14:45:48 +04:00
parent 8760d87cfc
commit 3b1c806dc8
@@ -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) {