diff options
author | 2016-11-14 22:07:24 +0000 | |
---|---|---|
committer | 2016-11-15 15:59:12 +0000 | |
commit | a0f3de38d17d5f06d7a1f33dd87be8fce5a56364 (patch) | |
tree | cdedade71245faaf5c6c13c93d1cfe0138bba0aa | |
parent | 6630c25b1c8c8d55b2afa2d37acd1a1ebcfe205b (diff) |
Only set the logging level if it has changed.
--
MOS_MIGRATED_REVID=139118594
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java index c16994f0d4..1ba369d0d1 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java @@ -147,6 +147,7 @@ public class BlazeCommandDispatcher { private String currentClientDescription = null; private String shutdownReason = null; private OutputStream logOutputStream = null; + private Level lastLogVerbosityLevel = null; private final LoadingCache<BlazeCommand, OpaqueOptionsData> optionsDataCache = CacheBuilder.newBuilder().build( new CacheLoader<BlazeCommand, OpaqueOptionsData>() { @@ -440,7 +441,10 @@ public class BlazeCommandDispatcher { } CommonCommandOptions commonOptions = optionsParser.getOptions(CommonCommandOptions.class); - BlazeRuntime.setupLogging(commonOptions.verbosity); + if (!commonOptions.verbosity.equals(lastLogVerbosityLevel)) { + BlazeRuntime.setupLogging(commonOptions.verbosity); + lastLogVerbosityLevel = commonOptions.verbosity; + } // Do this before an actual crash so we don't have to worry about // allocating memory post-crash. |