Logging needs completely to be rewritten. Look in inline comments for more information.

This commit is contained in:
Johannes Findeisen 2022-10-11 05:48:18 +02:00
commit 48bb65e1d5
2 changed files with 7 additions and 2 deletions

View file

@ -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 <you@hanez.org>'

View file

@ -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):