commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] [gnuradio] 30/57: runtime: configuring loggers in gr P


From: git
Subject: [Commit-gnuradio] [gnuradio] 30/57: runtime: configuring loggers in gr Python module for easy use in Python.
Date: Wed, 21 May 2014 03:10:27 +0000 (UTC)

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

trondeau pushed a commit to branch master
in repository gnuradio.

commit 9273fca3ee45fdf7c7fdb804a1f3c89aff4d1491
Author: Tom Rondeau <address@hidden>
Date:   Mon May 12 12:37:50 2014 -0400

    runtime: configuring loggers in gr Python module for easy use in Python.
    
    Can use gr.log.<level>('log message') or gr.log_debug directly from python 
to output logging info based on the [LOG] preferences.
---
 gnuradio-runtime/python/gnuradio/gr/__init__.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gnuradio-runtime/python/gnuradio/gr/__init__.py 
b/gnuradio-runtime/python/gnuradio/gr/__init__.py
index 94a5c9e..f093277 100644
--- a/gnuradio-runtime/python/gnuradio/gr/__init__.py
+++ b/gnuradio-runtime/python/gnuradio/gr/__init__.py
@@ -48,3 +48,11 @@ from gateway import basic_block, sync_block, decim_block, 
interp_block
 
 # Force the preference database to be initialized
 prefs = prefs.singleton
+
+log = gr.logger("gr_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_debug = gr.logger("gr_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"))



reply via email to

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