diff options
author | 2017-08-10 20:30:17 +0200 | |
---|---|---|
committer | 2017-08-11 12:56:15 +0200 | |
commit | a664a5118e552504ba7962e1cccfea43b51ef28e (patch) | |
tree | 0f0926df29537fc48208721818a24bc2817e1ee3 /src/main/java/com/google/devtools/build/lib/runtime | |
parent | 4435515d156dbb0cc40869de686d326b175f61b8 (diff) |
Make the print function output debug messages
RELNOTES: The `print` function now prints debug messages instead of warnings.
PiperOrigin-RevId: 164880003
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime')
3 files changed, 22 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandEventHandler.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandEventHandler.java index 400d958e3b..7d10f655cd 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandEventHandler.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandEventHandler.java @@ -299,6 +299,7 @@ public class BlazeCommandEventHandler implements EventHandler { case TIMEOUT: case ERROR: case WARNING: + case DEBUG: case DEPCHECKER: prefix = event.getKind() + ": "; break; diff --git a/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java b/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java index 93931536d1..def5a1e0a8 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/ExperimentalEventHandler.java @@ -339,6 +339,7 @@ public class ExperimentalEventHandler implements EventHandler { case FAIL: case WARNING: case INFO: + case DEBUG: case SUBCOMMAND: boolean incompleteLine; if (showProgress && buildRunning) { @@ -401,6 +402,9 @@ public class ExperimentalEventHandler implements EventHandler { case INFO: terminal.setTextColor(Color.GREEN); break; + case DEBUG: + terminal.setTextColor(Color.YELLOW); + break; case SUBCOMMAND: terminal.setTextColor(Color.BLUE); break; diff --git a/src/main/java/com/google/devtools/build/lib/runtime/FancyTerminalEventHandler.java b/src/main/java/com/google/devtools/build/lib/runtime/FancyTerminalEventHandler.java index 07234d5ef3..fa74355b31 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/FancyTerminalEventHandler.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/FancyTerminalEventHandler.java @@ -201,6 +201,11 @@ public class FancyTerminalEventHandler extends BlazeCommandEventHandler { // and scroll it. warning(event); break; + case DEBUG: + // For debug messages, highlight the word "Debug" in boldface yellow, + // and scroll it. + debug(event); + break; case SUBCOMMAND: subcmd(event); break; @@ -361,6 +366,18 @@ public class FancyTerminalEventHandler extends BlazeCommandEventHandler { crlf(); } + private void debug(Event debug) throws IOException { + previousLineErasable = false; + if (useColor) { + terminal.textYellow(); + } + terminal.writeString("DEBUG: "); + terminal.resetTerminal(); + writeTimestampAndLocation(debug); + writeStringWithPotentialPeriod(debug.getMessage()); + crlf(); + } + /** * Writes the given String to the terminal. This method also writes a trailing period if the * message doesn't end with a punctuation character. |