Open ngraymon opened 8 years ago
Initial implementation of logging: ckwatson/kernel@1525db050b68d7534a3916d17168e4b357c6d84f ckwatson/web_gui@53a1029620dfd091defee5a0e823e5befc3cdfc1
Current Issues:
Logging errors print to output twice. I believe this is a propagation error because the propagation of the logger is turned off.
Logging errors print to output twice.
This is because the logger
object has 2 handlers attached:
I checked this by turning off one of the handlers. When only one handler exists, the -- logging error --
only shows up once.
It is not a propagation error. It merely means that both the handlers are failing.
I think this "double-printing" error is inevitable at this time, unless we make sure no error would happen when trying to log something.
About the documentation: should we write them in a Wiki? For the time being, I'll just take a quick note down here:
For each module, add the following lines to the top:
import logging
logger = logging.getLogger(__name__)
Then we can send messages in various circumstances as described here.
Logging as described in the python documentation would greatly improve the health of the project.
Goals
Files requiring changes
Example change Replacing
print("\n Attempting to plot " + str(number_of_plots) + " concentration profiles")
withlogger.info('\n Attempting to plot " + str(number_of_plots) + " concentration profiles')
or `print("Another issue has been detected. Reaction "
with
logger.error('Another issue has been detected. Reaction "Steps to implement
web_gui
hasn't touched. This includes the native GUI also.