[oe-commits] [bitbake] 01/03: msg: Add explicit verbnote log level

git at git.openembedded.org git at git.openembedded.org
Fri Sep 7 16:49:33 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 2076f12cc2f809345108b1606bd6201f41287505
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Sep 7 14:06:37 2018 +0100

    msg: Add explicit verbnote log level
    
    It has become apparant we need a log level which reaches the console but
    isn't a warning/error. Add "verbnote" as a way of doing this, behaves as
    a note but with a higher priority.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/__init__.py | 16 ++++++++++++++++
 lib/bb/msg.py      |  3 +++
 2 files changed, 19 insertions(+)

diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py
index 4e9f6e3..170c592 100644
--- a/lib/bb/__init__.py
+++ b/lib/bb/__init__.py
@@ -63,6 +63,10 @@ class BBLogger(Logger):
     def verbose(self, msg, *args, **kwargs):
         return self.log(logging.INFO - 1, msg, *args, **kwargs)
 
+    def verbnote(self, msg, *args, **kwargs):
+        return self.log(logging.INFO + 2, msg, *args, **kwargs)
+
+
 logging.raiseExceptions = False
 logging.setLoggerClass(BBLogger)
 
@@ -93,6 +97,18 @@ def debug(lvl, *args):
 def note(*args):
     mainlogger.info(''.join(args))
 
+#
+# A higher prioity note which will show on the console but isn't a warning
+#
+# Something is happening the user should be aware of but they probably did
+# something to make it happen
+#
+def verbnote(*args):
+    mainlogger.verbnote(''.join(args))
+
+#
+# Warnings - things the user likely needs to pay attention to and fix
+#
 def warn(*args):
     mainlogger.warning(''.join(args))
 
diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index f1723be..96f077e 100644
--- a/lib/bb/msg.py
+++ b/lib/bb/msg.py
@@ -40,6 +40,7 @@ class BBLogFormatter(logging.Formatter):
     VERBOSE = logging.INFO - 1
     NOTE = logging.INFO
     PLAIN = logging.INFO + 1
+    VERBNOTE = logging.INFO + 2
     ERROR = logging.ERROR
     WARNING = logging.WARNING
     CRITICAL = logging.CRITICAL
@@ -51,6 +52,7 @@ class BBLogFormatter(logging.Formatter):
         VERBOSE: 'NOTE',
         NOTE    : 'NOTE',
         PLAIN  : '',
+        VERBNOTE: 'NOTE',
         WARNING : 'WARNING',
         ERROR   : 'ERROR',
         CRITICAL: 'ERROR',
@@ -66,6 +68,7 @@ class BBLogFormatter(logging.Formatter):
         VERBOSE : BASECOLOR,
         NOTE    : BASECOLOR,
         PLAIN   : BASECOLOR,
+        VERBNOTE: BASECOLOR,
         WARNING : YELLOW,
         ERROR   : RED,
         CRITICAL: RED,

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list