aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/events
diff options
context:
space:
mode:
authorGravatar vladmos <vladmos@google.com>2017-11-30 03:02:36 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-11-30 03:04:16 -0800
commit1df4635d2c790f555aeb20e6c43b30ea77a14c80 (patch)
tree54bc75ca37ebf9bbc64a5fe8e2cc4c046f58c134 /src/main/java/com/google/devtools/build/lib/events
parentbc7c6606e79efa21764885aee25ab7530d7d0674 (diff)
Do not filter debug messages
Debug messages (generated with Skylark's `print` function) used to be filtered out by the output filter: if such messages are generated during the analysis phase in a package different to the target package (e.g. if a user builds //foo:foo and the message is generated in a dependency //bar:bar), the message are not shown by default, which makes an erroneous impression that the code for //bar:bar hasn't been executed at all and interferes with debugging. Now the output filter doesn't affect debug messages at all. RELNOTES: Debug messages generated by `print()` are not being filtered out by --output_filter anymore, it's recommended not to use them in production code. PiperOrigin-RevId: 177431255
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/events')
-rw-r--r--src/main/java/com/google/devtools/build/lib/events/Reporter.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/events/Reporter.java b/src/main/java/com/google/devtools/build/lib/events/Reporter.java
index 6c164a1ebd..e654748422 100644
--- a/src/main/java/com/google/devtools/build/lib/events/Reporter.java
+++ b/src/main/java/com/google/devtools/build/lib/events/Reporter.java
@@ -70,7 +70,7 @@ public final class Reporter implements ExtendedEventHandler, ExceptionListener {
/** Constructor which configures a reporter with the specified handlers. */
public Reporter(EventBus eventBus, EventHandler... handlers) {
this.eventBus = eventBus;
- for (EventHandler handler: handlers) {
+ for (EventHandler handler : handlers) {
addHandler(handler);
}
}
@@ -103,7 +103,10 @@ public final class Reporter implements ExtendedEventHandler, ExceptionListener {
*/
@Override
public synchronized void handle(Event e) {
- if (e.getKind() != EventKind.ERROR && e.getTag() != null && !showOutput(e.getTag())) {
+ if (e.getKind() != EventKind.ERROR
+ && e.getKind() != EventKind.DEBUG
+ && e.getTag() != null
+ && !showOutput(e.getTag())) {
return;
}
for (EventHandler handler : handlers) {