You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time timeloop is started it adds a new logging handlers causing issues e.g. when using flask. Messages are sent multiple times. This could be fixed by releasing the handlers in the stop method by adding:
for h in self.logger.handlers:
self.logger.removeHandler(h)
Note that in this example the timeloop will still print multiple messages after my fix, as only the handler of the last instance is removed. I guess to make it cleanly the timeloop should be a "with as", the logging handler should only be attached once the process is started, use of the destructor... or check for existing handlers before creating a new one.
The text was updated successfully, but these errors were encountered:
Every time timeloop is started it adds a new logging handlers causing issues e.g. when using flask. Messages are sent multiple times. This could be fixed by releasing the handlers in the stop method by adding:
Example:
every message is sent 5 times:
Note that in this example the timeloop will still print multiple messages after my fix, as only the handler of the last instance is removed. I guess to make it cleanly the timeloop should be a "with as", the logging handler should only be attached once the process is started, use of the destructor... or check for existing handlers before creating a new one.
The text was updated successfully, but these errors were encountered: