Skip to content
Snippets Groups Projects
Commit 549eab3f authored by Hans Fangohr's avatar Hans Fangohr
Browse files

we only want one handler for shell output

so that multiple calls of the set_up_logging function do not create multiple
handlers (and then undesired multiple outputs for one plog message)
parent 64152d51
No related branches found
No related tags found
1 merge request!102Fix double plog output, version 2
Pipeline #375145 failed
......@@ -339,10 +339,11 @@ def set_up_logging(loglevel="warning", file_path=None):
# create formatter 'empty' formatter
formatter = logging.Formatter("%(message)s")
# create, format and add handler for shell output
# create, format and set handler for shell output
ch = logging.StreamHandler()
ch.setFormatter(formatter)
print_log.addHandler(ch)
print_log.handlers = [ch]
# if filename provided, write output of print_log to that file, too
if file_path:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment