From 48bb65e1d5a0b6a48f84ac79ff6704d1b8ae9993 Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Tue, 11 Oct 2022 05:48:18 +0200 Subject: [PATCH] Logging needs completely to be rewritten. Look in inline comments for more information. --- bin/linspector | 2 +- linspector/core/logger.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/linspector b/bin/linspector index ecf0a10..0a237a1 100755 --- a/bin/linspector +++ b/bin/linspector @@ -33,7 +33,7 @@ from linspector.core.monitors import Monitors # i currently only increase the 3rd number because the goal is that 0.19.* will become the first # stable version. -__version__ = '0.19.57.dev1' +__version__ = '0.19.58.dev1' __author__ = 'Johannes Findeisen ' diff --git a/linspector/core/logger.py b/linspector/core/logger.py index f3d3043..994746c 100644 --- a/linspector/core/logger.py +++ b/linspector/core/logger.py @@ -16,8 +16,13 @@ logger = getLogger('linspector') # wow, this is not process capable! i thought in a last commit that the problem ist fixed, but it # isn't!!! see here for more details: # https://docs.python.org/3/howto/logging-cookbook.html#logging-to-a-single-file-from-multiple-processes +# i think the native pythonic way should be used as described in the link above. # a different approach on handling this can be to use a exclusive log file for each process but -# this is not what i want. +# this is not what i want. maybe these links could be helpful too: +# https://pypi.org/project/multiprocessing-logging/ +# https://stackoverflow.com/questions/641420/how-should-i-log-while-using-multiprocessing-in-python/48668567 +# or i can log to one single file using stdout data and let the operating system do the file +# rotation but if the pythonic way works fine i should implement it directly in Linspector. # maybe subclass it from logging.Logger...? class Log: def __init__(self, configuration, stdout, verbose):