aboutsummaryrefslogtreecommitdiffstats
path: root/src/gr-fadingui/python/logger.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/gr-fadingui/python/logger.py')
-rw-r--r--src/gr-fadingui/python/logger.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gr-fadingui/python/logger.py b/src/gr-fadingui/python/logger.py
new file mode 100644
index 0000000..a189aeb
--- /dev/null
+++ b/src/gr-fadingui/python/logger.py
@@ -0,0 +1,14 @@
+import logging
+import sys
+
+formatter = logging.Formatter("[%(name)s] %(levelname)s: %(message)s")
+stdout_handler = logging.StreamHandler(sys.stdout)
+
+def get_logger(module):
+ log = logging.getLogger(module)
+
+ log.addHandler(stdout_handler)
+ stdout_handler.setFormatter(formatter)
+
+ log.setLevel(logging.DEBUG)
+ return log