aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/util
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2015-08-04 03:47:04 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-08-04 09:09:29 +0000
commitae9b95f9f216d96d4caf775e5fd6f83bc6444042 (patch)
tree85527dcb760c385fa04b6cef4d942e2f4f1edd2d /src/main/java/com/google/devtools/build/lib/util
parente927532a03addbcdd1e716b8453b53d9c3eb98e1 (diff)
Crash in tests if anybody tries to log remotely. Remote logging usually indicates an error, and tests shouldn't normally have such errors.
-- MOS_MIGRATED_REVID=99789434
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/util')
-rw-r--r--src/main/java/com/google/devtools/build/lib/util/LoggingUtil.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/util/LoggingUtil.java b/src/main/java/com/google/devtools/build/lib/util/LoggingUtil.java
index 5170727c6e..6edcd004e5 100644
--- a/src/main/java/com/google/devtools/build/lib/util/LoggingUtil.java
+++ b/src/main/java/com/google/devtools/build/lib/util/LoggingUtil.java
@@ -46,6 +46,14 @@ public final class LoggingUtil {
remoteLogger = logger;
}
+ /**
+ * Installs the remote logger. Same as {@link #installRemoteLogger}, but since multiple tests will
+ * run in the same JVM, does not assert that this is the first time the logger is being installed.
+ */
+ public static synchronized void installRemoteLoggerForTesting(Future<Logger> logger) {
+ remoteLogger = logger;
+ }
+
/** Returns the installed logger, or null if none is installed. */
public static synchronized Logger getRemoteLogger() {
try {