The python logging method can be set to print the time of each event. However if I am running a simulation with its own time variable can that be used in the logger?
The logging Formatter doesn’t seem to have an option for that. Can I overload each of the logger functions?
I would like something like:
counter = 5
logging.debug("First Event")
counter += 2
logging.warn("Second Event")
to produce
DEBUG: 5: First Event
WARNING: 7: Second Event
You could use a
logging.Filter:yields