diff options
author | Seth Hitefield <sdhitefield@gmail.com> | 2020-09-15 10:24:03 -0400 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2021-01-11 12:27:55 -0800 |
commit | 43eac48b42c781c66b56279ff76e1b3d401f2753 (patch) | |
tree | 08d45757aa17c0f1027e6f7f888af2763a6dd9c5 /grc | |
parent | d165fe90e7318bc82f094dd5a64ae4294ec7d997 (diff) |
grc: Remove extra logger in grc/core/platform
This is an update for PR #2424. The extra debug output from GRC was
being generated by another logger instance in grc/core/platform that
did not respect the command line arguments.
This removes the extra logger and sets the logger level in main to
whatever is requested from the command line. See grc/main.py:43 for more
detail.
Diffstat (limited to 'grc')
-rw-r--r-- | grc/core/platform.py | 1 | ||||
-rwxr-xr-x | grc/main.py | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/grc/core/platform.py b/grc/core/platform.py index 7426c178f6..8ba473a2cc 100644 --- a/grc/core/platform.py +++ b/grc/core/platform.py @@ -26,7 +26,6 @@ from .FlowGraph import FlowGraph from .Connection import Connection logger = logging.getLogger(__name__) -logging.basicConfig(level=logging.INFO) class Platform(Element): diff --git a/grc/main.py b/grc/main.py index f3b43d662a..06097ed58d 100755 --- a/grc/main.py +++ b/grc/main.py @@ -40,7 +40,15 @@ def main(): # Enable logging # Note: All other modules need to use the 'grc.<module>' convention log = logging.getLogger('grc') - log.setLevel(logging.INFO) + # NOTE: This sets the log level to what was requested for the logger on the + # command line, but this may not be the correct approach if multiple handlers + # are intended to be used. The logger level shown here indicates all the log + # messages that are captured and the handler levels indicate messages each + # handler will output. A better approach may be resetting this to logging.DEBUG + # to catch everything and making sure the handlers have the correct levels set. + # This would be useful for a future GUI logging window that can filter messages + # independently of the console output. In this case, this should be DEBUG. + log.setLevel(LOG_LEVELS[args.log]) # Console formatting console = logging.StreamHandler() |