gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-taler-util] 21/51: 4453.


From: gnunet
Subject: [GNUnet-SVN] [taler-taler-util] 21/51: 4453.
Date: Mon, 23 Sep 2019 22:02:12 +0200

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

ng0 pushed a commit to branch master
in repository taler-util.

commit 21c69713e423c41ab071d6926801fee6631c87d4
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Feb 6 15:39:34 2019 +0100

    4453.
    
    Fix empty component field given in env vars.
---
 python/log/gnunet_log.py |  2 +-
 python/log/test.py       | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/python/log/gnunet_log.py b/python/log/gnunet_log.py
index 9c1c976..a39d92a 100755
--- a/python/log/gnunet_log.py
+++ b/python/log/gnunet_log.py
@@ -102,7 +102,7 @@ class GnunetLogger:
             if defi.forced or not self.loglevel:
                 # Temporarily checking only the component name.
                 # To be extended with all the others definition-parts.
-                if self.component == defi.component:
+                if self.component == defi.component or "" == defi.component:
                     self.logger.setLevel(
                         
level=self.string_to_loglevel(defi.loglevel).getLevel())
                     message_loglevel.getFunction()(message)
diff --git a/python/log/test.py b/python/log/test.py
index 76a7c1a..8467c51 100755
--- a/python/log/test.py
+++ b/python/log/test.py
@@ -35,6 +35,15 @@ gl.setup(gl.INFO)
 gl.log("I am a DEBUG message, and I should get displayed", gl.DEBUG)
 gl.log("I am a WARNING message, and I should get displayed", gl.WARNING)
 
+print("Testing with GNUNET_FORCE_LOG *set* to DEBUG and _empty_ component 
field")
+os.environ["GNUNET_FORCE_LOG"] = ";;;;DEBUG"
+
+gl = GL("gnunetish-python-logging")
+gl.setup(gl.WARNING)
+
+gl.log("I am a DEBUG message, and I should get displayed", gl.DEBUG)
+gl.log("I am a WARNING message, and I should get displayed", gl.WARNING)
+
 print("Testing with NO forced definitions neither one setup")
 del os.environ["GNUNET_FORCE_LOG"]
 gl = GL("gnunetish-python-logging")
@@ -47,9 +56,10 @@ gl = GL("gnunetish-python-logging")
 gl.log("I am a WARNING message and I should *not* get displayed", gl.WARNING)
 gl.log("I am a ERROR message and I should get displayed", gl.ERROR)
 
-print("Testing with GNUNET_FORCE_LOGFILE set to /tmp/{}.log")
+print("Testing with GNUNET_FORCE_LOGFILE set to 
/tmp/{}-pid_[]-year_%Y-month_%m-day_%d.log")
 del os.environ["GNUNET_LOG"]
 os.environ["GNUNET_FORCE_LOGFILE"] = 
"/tmp/{}-pid_[]-year_%Y-month_%m-day_%d.log"
+# It uses the default INFO level.
 gl = GL("gnunetish-python-logging")
 gl.log("I'm a ERROR message, and should go to 
/tmp/{}-[]-year_%Y-month_%m-day_%d.log", gl.ERROR)
 gl.log("I'm a DEBUG message, and should *not* go to 
/tmp/{}-pid_[]-year_%Y-month_%m-day_%d.log (& console)", gl.DEBUG)

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]