From 95ddada6c7335c45cfb654aacffec204e1a2e9cd Mon Sep 17 00:00:00 2001 From: jMyles Date: Mon, 23 Sep 2019 22:15:51 -0700 Subject: [PATCH 1/2] Console logging can now be paused. Fixes #1353. --- nucypher/utilities/logging.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nucypher/utilities/logging.py b/nucypher/utilities/logging.py index 7f2ba4b26..232cc5573 100644 --- a/nucypher/utilities/logging.py +++ b/nucypher/utilities/logging.py @@ -14,7 +14,7 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with nucypher. If not, see . """ - +from contextlib import contextmanager from functools import lru_cache import pathlib @@ -79,6 +79,16 @@ class GlobalLoggerSettings: def stop_console_logging(cls): globalLogPublisher.removeObserver(console_observer) + @classmethod + @contextmanager + def pause_console_logging_while(cls): + was_already_going = console_observer in globalLogPublisher._observers + if was_already_going: + globalLogPublisher.removeObserver(console_observer) + yield + if was_already_going: + globalLogPublisher.addObserver(console_observer) + @classmethod def start_text_file_logging(cls): globalLogPublisher.addObserver(get_text_file_observer()) From 44a9ce9c006601eacb498d5be441e36c80c9f3d6 Mon Sep 17 00:00:00 2001 From: jMyles Date: Sat, 21 Sep 2019 13:13:01 -0700 Subject: [PATCH 2/2] What do we want? TO CAPTURE TEST RESULTS! When do we want it? ALWAYS! --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5a6c39675..a40672bc9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -298,6 +298,7 @@ commands: command: | mkdir -p ~/test-logs/ mv ~/.cache/nucypher/log/nucypher.log ~/test-logs/nucypher-container-$CIRCLE_NODE_INDEX.log + when: always - store_artifacts: path: ~/test-logs/