← Back to team overview

sikuli-driver team mailing list archive

[Question #230928]: Logging does not work as expected

 

New question #230928 on Sikuli:
https://answers.launchpad.net/sikuli/+question/230928

I have designed few automation scripts and now want to create few log files. Since I understood that standard Python functionality should work, I just went through few Python tutorials about how to create log files.

However for some reason, it seems that what works normally in Python interpreter, doesn't work in Sikuli-IDE.
For example I have this simple example:

import logging
logging.warning('Watch out!') # will print a message to the console
logging.info('I told you so') # will not print anything

In this case (as stated in the comments), I should not see the second line in console. This is since warning is the default log level in Python and the only one which should appear in the console. However, when I run this code in Sikuli-IDE, I have both lines being printed in the console.


Second example is this one:

import logging
logging.basicConfig(filename='example.log',level=logging.DEBUG)
logging.debug('This message should go to the log file')
logging.info('So should this')
logging.warning('And this, too')

Here I expect the 'example.log' file to be created and include all the log events. In this case, no file is being created after the execution.

In both cases the execution is done successfully and work as expected when I try it in Python interpreter directly (I tested in Python 3.3.2)


Any idea why are these differences appear?

Thanks!
Eugene

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.