diff --git a/CHANGELOG.md b/CHANGELOG.md index de310483..130ce45a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning][semver]. ### Added +- Add support for fully disabling tuf logging ([154]) - Add support for including additional custom information when exporting historical data ([147]) ### Changed @@ -20,7 +21,10 @@ and this project adheres to [Semantic Versioning][semver]. - Minor YubiKey mock fix ([153]) - Updated some git methods so that it is checked if the returned value is not `None` before calling strip ([153]) + +[154]: https://github.com/openlawlibrary/taf/pull/154 [153]: https://github.com/openlawlibrary/taf/pull/153 +[147]: https://github.com/openlawlibrary/taf/pull/147 ## [0.6.1] - 09/09/2020 @@ -33,9 +37,7 @@ and this project adheres to [Semantic Versioning][semver]. ### Fixed -[153]: https://github.com/openlawlibrary/taf/pull/153 [148]: https://github.com/openlawlibrary/taf/pull/148 -[147]: https://github.com/openlawlibrary/taf/pull/147 ## [0.6.0] - 08/11/2020 diff --git a/taf/log.py b/taf/log.py index 9f7cb644..fae0b199 100644 --- a/taf/log.py +++ b/taf/log.py @@ -29,6 +29,15 @@ def disable_tuf_console_logging(): pass +def disable_tuf_file_logging(): + if tuf.log.file_handler is not None: + tuf.log.disable_tuf_file_logging() + else: + logging.getLogger("tuf").setLevel(logging.CRITICAL) + logging.getLogger("securesystemslib_keys").setLevel(logging.CRITICAL) + logging.getLogger("securesystemslib_util").setLevel(logging.CRITICAL) + + def _get_log_location(): location = settings.LOGS_LOCATION or os.environ.get("TAF_LOG") if location is None: @@ -71,4 +80,4 @@ def _get_log_location(): pass else: # if file logging is disabled, also disable tuf file logging - tuf.log.disable_file_logging() + disable_tuf_file_logging()