metrics_utils: Print notice to stderr.

Print notice to stderr to avoid interfering with scripts that parse stdout.

Bug: 832386
Change-Id: Ifbcc52809213311489f5c8434b3c16ea53373e57
Reviewed-on: https://chromium-review.googlesource.com/1145697
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
changes/97/1145697/2
Edward Lemur 7 years ago committed by Commit Bot
parent 32455bd06c
commit c87d45b102

@ -3,6 +3,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import scm
import subprocess2
import sys
@ -103,9 +105,9 @@ def get_repo_timestamp(path_to_repo):
def print_notice(countdown):
"""Print a notice to let the user know the status of metrics collection."""
colorama.init()
print colorama.Fore.RED + '\033[1m'
print(colorama.Fore.RED + '\033[1m', file=sys.stderr)
if countdown:
print NOTICE_COUNTDOWN_HEADER % countdown
print(NOTICE_COUNTDOWN_HEADER % countdown, file=sys.stderr)
else:
print NOTICE_COLLECTION_HEADER
print NOTICE_FOOTER + colorama.Style.RESET_ALL
print(NOTICE_COLLECTION_HEADER, file=sys.stderr)
print(NOTICE_FOOTER + colorama.Style.RESET_ALL, file=sys.stderr)

Loading…
Cancel
Save