From f7d5a265e173224ec184851a77180ad26e763465 Mon Sep 17 00:00:00 2001 From: Andy Twigg Date: Fri, 31 May 2019 14:26:45 -0700 Subject: [PATCH] suppress excessive messages from unused loggers (#920) Only print the "logging to [dir]" message when the logger has something to output. Running with the new spawn change and both mpi and subprocvecenv, there are many "logging to [dir]" messages but most are not logging anything. --- baselines/logger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/baselines/logger.py b/baselines/logger.py index 36b0c98..77d40ba 100644 --- a/baselines/logger.py +++ b/baselines/logger.py @@ -394,7 +394,8 @@ def configure(dir=None, format_strs=None, comm=None, log_suffix=''): output_formats = [make_output_format(f, dir, log_suffix) for f in format_strs] Logger.CURRENT = Logger(dir=dir, output_formats=output_formats, comm=comm) - log('Logging to %s'%dir) + if output_formats: + log('Logging to %s'%dir) def _configure_default_logger(): configure()