diff options
| author | Brian Potchik <brian@vector35.com> | 2020-09-16 15:26:47 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2020-09-16 15:26:47 -0400 |
| commit | 766746a4c82730f266e2ddd0dcb84eb4a09d56ca (patch) | |
| tree | c1aa0b0fbf53d429e538e0d75a73e88b455065ea /python/__init__.py | |
| parent | 054be043b9b819406a91e3c4c4447015c5d90283 (diff) | |
Add setting to control logging in headless.
Diffstat (limited to 'python/__init__.py')
| -rw-r--r-- | python/__init__.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/python/__init__.py b/python/__init__.py index d26f5a73..f4a91250 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -164,8 +164,9 @@ def _init_plugins(): global _plugin_init if not _plugin_init: result = core.BNInitCorePlugins() - if result is True and not core_ui_enabled() and sys.stderr.isatty(): - log_to_stderr(LogLevel.InfoLog) + min_level = Settings().get_string("python.log.minLevel") + if result and min_level in LogLevel.__members__ and not core_ui_enabled() and sys.stderr.isatty(): + log_to_stderr(LogLevel[min_level]) if not os.environ.get('BN_DISABLE_USER_PLUGINS'): core.BNInitUserPlugins() core.BNInitRepoPlugins() @@ -177,11 +178,6 @@ def _init_plugins(): _destruct_callbacks = _DestructionCallbackHandler() -def disable_logging(): - '''Disable logging in headless mode. By default, logging is enabled in headless mode.''' - _init_plugins() - close_logs() - def bundled_plugin_path(): """ ``bundled_plugin_path`` returns a string containing the current plugin path inside the `install path <https://docs.binary.ninja/getting-started.html#binary-path>`_ |
