]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
patman: Update errors and warnings to use stderr
authorSimon Glass <sjg@chromium.org>
Fri, 10 Jul 2020 00:39:39 +0000 (18:39 -0600)
committerSimon Glass <sjg@chromium.org>
Sat, 25 Jul 2020 20:46:57 +0000 (14:46 -0600)
When warnings and errors are produced by tools they should be written to
stderr. Update the tout implementation to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
tools/binman/ftest.py
tools/patman/tout.py

index 7c8b3eb3a093e216e9a68f43f847e53b06d79f5d..928d3608a31a72af739f38d069514295568a7a02 100644 (file)
@@ -3232,7 +3232,7 @@ class TestFunctional(unittest.TestCase):
         with test_util.capture_sys_output() as (stdout, stderr):
             control.ReplaceEntries(updated_fname, None, outdir, [])
         self.assertIn("Skipping entry '/u-boot' from missing file",
-                      stdout.getvalue())
+                      stderr.getvalue())
 
     def testReplaceCmdMap(self):
         """Test replacing a file fron an image on the command line"""
index c7e32720965769014d23ef264db7735e9c68ef18..91a53f4073d2e4d3736f17f422a069f954d67aae 100644 (file)
@@ -83,7 +83,10 @@ def _Output(level, msg, color=None):
         ClearProgress()
         if color:
             msg = _color.Color(color, msg)
-        print(msg)
+        if level < NOTICE:
+            print(msg, file=sys.stderr)
+        else:
+            print(msg)
 
 def DoOutput(level, msg):
     """Output a message to the terminal.