- January 3, 2021
- January 3, 2021
Python: Output the log with logging module
It is general to export the log from the batch script which is executed periodically. The log is also useful to analyze the problem. You may insert the special log for debug to explore the reason of bug. The log is base facility to explore the reason of problem and recover from it. You can output the log from Python script with logging module. Simple Logging Most simple logging code is following. import logging logging.basicConfig(level=logging.INFO) logging.info("Most Simple Log. The Value is %d.", 10) Execute this script, the following log will be output. $ python3 demo.py INFO:root:Most Simple Log. The Value is […]