Logging and reporting in Sikuli scripts
- Last updated by:
- RaiMan on on 2013-01-21
This from comment # 4 (Harry Riedinger https:/
of question https:/
The python logging class is very easy to set up and I recommend using that for logging.
information on python logging is here: http://
here is a quick, basic example of using logging:
# when run in IDE with reruns to avoid errors use
import logging; reload(logging)
#create a new logging instance
logger = logging.
#set the file to log to
#set the logging level, DEBUG is the most verbose level
logger.info("We are starting now")
# do something that might fail
You can also set up filters and log to different files depending on the log level.
Because logger uses handlers, you can do all this with a single logging instance.
It is a very flexible logging solution.