diff options
author | Nao Pross <np@0hm.ch> | 2021-11-21 10:40:53 +0100 |
---|---|---|
committer | Nao Pross <np@0hm.ch> | 2021-11-21 10:40:53 +0100 |
commit | 2a3b0ef715d83c97ccb0c2b1eb63707a62ffe7a5 (patch) | |
tree | f45e5b6f5ec5a88456d94abc0a63173f355d2571 /src/gr-fadingui/python/logger.py | |
parent | Change chapter title (diff) | |
parent | Merge branch 'master' of github.com:NaoPross/Fading (diff) | |
download | Fading-2a3b0ef715d83c97ccb0c2b1eb63707a62ffe7a5.tar.gz Fading-2a3b0ef715d83c97ccb0c2b1eb63707a62ffe7a5.zip |
Merge branch 'master' of github.com:NaoPross/Fading
Diffstat (limited to '')
-rw-r--r-- | src/gr-fadingui/python/logger.py | 14 |
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 |