[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-taler-util] 20/51: 4453.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-taler-util] 20/51: 4453. |
Date: |
Mon, 23 Sep 2019 22:02:11 +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 3c42d73724a3ccbf22c7cf542b20b67fab3e6548
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Feb 6 15:12:27 2019 +0100
4453.
Fix and test GNUNET_FORCE_LOGFILE.
---
python/log/gnunet_log.py | 8 ++++----
python/log/test.py | 8 ++++++++
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/python/log/gnunet_log.py b/python/log/gnunet_log.py
index 7eb6778..9c1c976 100755
--- a/python/log/gnunet_log.py
+++ b/python/log/gnunet_log.py
@@ -66,11 +66,11 @@ class GnunetLogger:
def parse_filename(self, filename):
# implement {} and [] substitution.
self.filename = filename.replace("{}", self.component)
- self.filename = self.filename.replace("[]", os.getpid())
+ self.filename = self.filename.replace("[]", str(os.getpid()))
now = datetime.datetime.now()
- self.filename = self.filaneme.replace("%Y", now.strftime("%Y"))
- self.filename = self.filaneme.replace("%m", now.strftime("%m"))
- self.filename = self.filaneme.replace("%d", now.strftime("%d"))
+ self.filename = self.filename.replace("%Y", now.strftime("%Y"))
+ self.filename = self.filename.replace("%m", now.strftime("%m"))
+ self.filename = self.filename.replace("%d", now.strftime("%d"))
return self.filename
def string_to_loglevel(self, level):
diff --git a/python/log/test.py b/python/log/test.py
index 2cfaff0..76a7c1a 100755
--- a/python/log/test.py
+++ b/python/log/test.py
@@ -46,3 +46,11 @@ os.environ["GNUNET_LOG"] =
"gnunetish-python-logging;;;;ERROR"
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")
+del os.environ["GNUNET_LOG"]
+os.environ["GNUNET_FORCE_LOGFILE"] =
"/tmp/{}-pid_[]-year_%Y-month_%m-day_%d.log"
+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.
- [GNUnet-SVN] [taler-taler-util] 12/51: make map static, (continued)
- [GNUnet-SVN] [taler-taler-util] 12/51: make map static, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 25/51: 4453. Parsing line interval., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 11/51: Towards a usable solution for #4453., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 13/51: Give loglevels dedicate class + test., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 16/51: Updating Amount from bank., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 19/51: Parsing GNUNET_FORCE_LOGFILE., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 26/51: 4453. Check against further fields (filename, func, lineno), gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 17/51: 4453., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 24/51: fix filename extraction., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 18/51: 4453., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 20/51: 4453.,
gnunet <=
- [GNUnet-SVN] [taler-taler-util] 22/51: 4453, use regex., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 15/51: Update amount., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 21/51: 4453., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 23/51: fetch caller's metadata., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 29/51: rename function, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 30/51: Testing env var GNUNET_LOG., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 32/51: 4453. Testing mixed situation,, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 37/51: fix after file rename, gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 38/51: 4453. Test GNUNET_FORCE_LOGFILE., gnunet, 2019/09/23
- [GNUnet-SVN] [taler-taler-util] 50/51: Make tests work again., gnunet, 2019/09/23