mirror of https://github.com/nucypher/nucypher.git
Need a way to pause all logging for massive Ursula tests.
parent
946282da4d
commit
a6d3e5841f
|
@ -433,6 +433,8 @@ class Learner:
|
|||
# In some cases (seed nodes or other temp stored certs),
|
||||
# this will update the filepath from the temp location to this one.
|
||||
node.certificate_filepath = certificate_filepath
|
||||
|
||||
|
||||
self.log.info(f"Saved TLS certificate for {node.nickname}: {certificate_filepath}")
|
||||
|
||||
try:
|
||||
|
|
|
@ -95,6 +95,16 @@ class GlobalLoggerSettings:
|
|||
if was_already_going:
|
||||
globalLogPublisher.addObserver(console_observer)
|
||||
|
||||
@classmethod
|
||||
@contextmanager
|
||||
def pause_all_logging_while(cls):
|
||||
former_observers = tuple(globalLogPublisher._observers)
|
||||
for observer in former_observers:
|
||||
globalLogPublisher.removeObserver(observer)
|
||||
yield
|
||||
for observer in former_observers:
|
||||
globalLogPublisher.addObserver(observer)
|
||||
|
||||
@classmethod
|
||||
def start_text_file_logging(cls):
|
||||
globalLogPublisher.addObserver(get_text_file_observer())
|
||||
|
|
Loading…
Reference in New Issue