diff options
author | ccalvarin <ccalvarin@google.com> | 2018-08-01 11:23:03 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-01 11:25:24 -0700 |
commit | a0ca5acbbd6c86d91b5891215591a51fd6b0d83a (patch) | |
tree | 377dd4222606b32019dc34ca44742f540a52bcbb /src/test/shell | |
parent | 6243023bd7b0a86c473fda683f9071e92ed1128c (diff) |
Make sure that user-level log messages are not lost in a buffer if debug
logging is turned off.
WARNINGs, ERRORs, and simple USER messages get printed to stderr when debug logging is disabled, which it is by default. However, before this change, these were lost if they were sent to BAZEL_LOG before Bazel knew whether or not debug logging was requested. This fixes that by maintaining separate buffers, and dumping only the appropriate one to stderr once we know whether or not it is wanted.
Maintaining the separate buffer also allows for it to be easy to, in the future, allow logging to multiple places, if we are logging details to a file and user-level details to stderr, for example.
RELNOTES: None.
PiperOrigin-RevId: 206960686
Diffstat (limited to 'src/test/shell')
-rwxr-xr-x | src/test/shell/integration/bazel_command_log_test.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/shell/integration/bazel_command_log_test.sh b/src/test/shell/integration/bazel_command_log_test.sh index 3e7443c353..8094e65a19 100755 --- a/src/test/shell/integration/bazel_command_log_test.sh +++ b/src/test/shell/integration/bazel_command_log_test.sh @@ -31,6 +31,8 @@ function strip_lines_from_bazel_cc() { # file). In newer versions of gnu sed there is a -i option to edit in place. # different sandbox_root result in different startup options + # TODO(b/5568649): Remove host_javabase from tests and stop removing the + # warning from the stderr output. clean_log=$(\ sed \ -e "/^INFO: Reading 'startup' options from /d" \ @@ -41,6 +43,7 @@ function strip_lines_from_bazel_cc() { -e '/^Killed non-responsive server process/d' \ -e '/server needs to be killed, because the startup options are different/d' \ -e '/^WARNING: Waiting for server process to terminate (waited 5 seconds, waiting at most 60)$/d' \ + -e '/^WARNING: The startup option --host_javabase is deprecated; prefer --server_javabase.$/d' \ $TEST_log) echo "$clean_log" > $TEST_log |