We hit this error intermittently as we have to reinitialize our logger at least once during our application startup.
File "/opt/pysetup/.venv/lib/python3.11/site-packages/loguru/_logger.py", line 2031, in _log
for handler in core.handlers.values():
RuntimeError: dictionary changed size during iteration
We hit this error intermittently as we have to reinitialize our logger at least once during our application startup.
I think this can be fixed by adding a lock before this line: https://github.com/Delgan/loguru/blob/master/loguru/_logger.py#L2036
or making sure it is iterating over a copy: