GitHandler: use separate logger to log the command duration (when it didn't take too long).

This commit is contained in:
Kirill Likhodedov
2016-01-06 15:30:06 +03:00
parent d0f63b88e1
commit ff25be988f
@@ -70,6 +70,7 @@ public abstract class GitHandler {
protected static final Logger LOG = Logger.getInstance(GitHandler.class);
protected static final Logger OUTPUT_LOG = Logger.getInstance("#output." + GitHandler.class.getName());
private static final Logger TIME_LOG = Logger.getInstance("#time." + GitHandler.class.getName());
protected final Project myProject;
protected final GitCommand myCommand;
@@ -757,11 +758,11 @@ public abstract class GitHandler {
private void logTime() {
if (myStartTime > 0) {
long time = System.currentTimeMillis() - myStartTime;
if (!LOG.isDebugEnabled() && time > LONG_TIME) {
if (!TIME_LOG.isDebugEnabled() && time > LONG_TIME) {
LOG.info(String.format("git %s took %s ms. Command parameters: %n%s", myCommand, time, myCommandLine.getCommandLineString()));
}
else {
LOG.debug(String.format("git %s took %s ms", myCommand, time));
TIME_LOG.debug(String.format("git %s took %s ms", myCommand, time));
}
}
else {