commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 13/13: logger: fixed a problem with the Pyt


From: git
Subject: [Commit-gnuradio] [gnuradio] 13/13: logger: fixed a problem with the Python loggers not respecting the log_file and debug_file settings in the logger preferences file.
Date: Thu, 4 Dec 2014 16:21:51 +0000 (UTC)

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

trondeau pushed a commit to branch maint
in repository gnuradio.

commit ec05c9bf90dcf612ba3e8b52a5d74df82a4ac868
Author: Tom Rondeau <address@hidden>
Date:   Wed Dec 3 13:29:16 2014 -0500

    logger: fixed a problem with the Python loggers not respecting the log_file 
and debug_file settings in the logger preferences file.
---
 gnuradio-runtime/python/gnuradio/gr/__init__.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gnuradio-runtime/python/gnuradio/gr/__init__.py 
b/gnuradio-runtime/python/gnuradio/gr/__init__.py
index 4fc55c6..9717390 100644
--- a/gnuradio-runtime/python/gnuradio/gr/__init__.py
+++ b/gnuradio-runtime/python/gnuradio/gr/__init__.py
@@ -50,9 +50,17 @@ from gateway import basic_block, sync_block, decim_block, 
interp_block
 prefs = prefs.singleton
 
 log = gr.logger("log")
-log.add_console_appender(prefs().get_string("LOG", "log_level", "off"), 
'gr::log %d :%p: %m%n')
 log.set_level(prefs().get_string("LOG", "log_level", "notset"))
+log_file = gr.prefs().get_string("LOG", "log_file", "");
+if(log_file == "stderr" or log_file == "stdout"):
+    log.add_console_appender(log_file, "gr::log %d :%p: %m%n")
+else:
+    log.add_file_appender(log_file, True, "%r :%p: %c{1} - %m%n")
 
 log_debug = gr.logger("log_debug")
-log_debug.add_console_appender(prefs().get_string("LOG", "debug_level", 
"off"), 'gr::debug %d :%p: %m%n')
 log_debug.set_level(prefs().get_string("LOG", "debug_level", "notset"))
+log_debug_file = gr.prefs().get_string("LOG", "debug_file", "");
+if(log_debug_file == "stderr" or log_file == "stdout"):
+    log_debug.add_console_appender(log_debug_file, "gr::log %d :%p: %m%n")
+else:
+    log_debug.add_file_appender(log_debug_file, True, "%r :%p: %c{1} - %m%n")



reply via email to

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