aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/FancyTerminalEventHandler.java
diff options
context:
space:
mode:
authorGravatar vladmos <vladmos@google.com>2017-08-10 20:30:17 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-08-11 12:56:15 +0200
commita664a5118e552504ba7962e1cccfea43b51ef28e (patch)
tree0f0926df29537fc48208721818a24bc2817e1ee3 /src/main/java/com/google/devtools/build/lib/runtime/FancyTerminalEventHandler.java
parent4435515d156dbb0cc40869de686d326b175f61b8 (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/FancyTerminalEventHandler.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/FancyTerminalEventHandler.java17
1 files changed, 17 insertions, 0 deletions
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.