[U-Boot,13/53] patman: Update tout to avoid open-coding the debug levels
diff mbox series

Message ID 20190720182416.183626-14-sjg@chromium.org
State Accepted
Commit fd07336211c3b3088dce20b1c22a99e6303c68c2
Delegated to: Simon Glass
Headers show
Series
  • binman: Support replacing entries in an existing image
Related show

Commit Message

Simon Glass July 20, 2019, 6:23 p.m. UTC
Use the debug level constants instead of open-coding them in the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/patman/tout.py | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

Comments

Simon Glass July 29, 2019, 9:22 p.m. UTC | #1
Use the debug level constants instead of open-coding them in the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/patman/tout.py | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

Applied to u-boot-dm, thanks!

Patch
diff mbox series

diff --git a/tools/patman/tout.py b/tools/patman/tout.py
index ae04c30f1db..2a384851b0d 100644
--- a/tools/patman/tout.py
+++ b/tools/patman/tout.py
@@ -11,11 +11,7 @@  import sys
 import terminal
 
 # Output verbosity levels that we support
-ERROR = 0
-WARNING = 1
-NOTICE = 2
-INFO = 3
-DEBUG = 4
+ERROR, WARNING, NOTICE, INFO, DETAIL, DEBUG = range(6)
 
 in_progress = False
 
@@ -107,7 +103,7 @@  def Error(msg):
     Args:
         msg; Message to display.
     """
-    _Output(0, msg, _color.RED)
+    _Output(ERROR, msg, _color.RED)
 
 def Warning(msg):
     """Display a warning message
@@ -115,7 +111,7 @@  def Warning(msg):
     Args:
         msg; Message to display.
     """
-    _Output(1, msg, _color.YELLOW)
+    _Output(WARNING, msg, _color.YELLOW)
 
 def Notice(msg):
     """Display an important infomation message
@@ -123,7 +119,7 @@  def Notice(msg):
     Args:
         msg; Message to display.
     """
-    _Output(2, msg)
+    _Output(NOTICE, msg)
 
 def Info(msg):
     """Display an infomation message
@@ -131,7 +127,7 @@  def Info(msg):
     Args:
         msg; Message to display.
     """
-    _Output(3, msg)
+    _Output(INFO, msg)
 
 def Detail(msg):
     """Display a detailed message
@@ -139,7 +135,7 @@  def Detail(msg):
     Args:
         msg; Message to display.
     """
-    _Output(4, msg)
+    _Output(DETAIL, msg)
 
 def Debug(msg):
     """Display a debug message
@@ -147,7 +143,7 @@  def Debug(msg):
     Args:
         msg; Message to display.
     """
-    _Output(5, msg)
+    _Output(DEBUG, msg)
 
 def UserOutput(msg):
     """Display a message regardless of the current output level.