Open trz42 opened 1 year ago
One aspect of this is to avoid that we have two separate logs for event handler (event_handler.log
and pyghee.log
).
We should also have a single log
function that makes sure that all log messages have the same format, are timestamped, mention where the log messages was coming from, etc.
We could also try and make both components log to a single place, which would require locking the log file while it's being written to (again a reason to have a single log file that we use everywhere).
Logging could implement different levels, channels, include the current function name and be duplicated to stdout/stderr on request (e.g., in debugging sessions).
tasks/deploy.py
may be a good starting point. Also, https://stackoverflow.com/questions/5067604/determine-function-name-from-within-that-function-without-using-traceback may be a good resource to look into.Also, it could be made more transparent to what file information is logged and to set this just once (at the start up) without the need to repeatedly adding the name of a
log_file
.