issues when using Python logging module in sikuli
Hi all,
i have issues when using Python logging module in sikuli
run following script in sikuli ide :
import 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
logger.
#set the logging level, DEBUG is the most verbose level
logger.
logger.info("We are starting now")
def functionInMyScr
logger.
# do something that might fail
print("run function success!!")
logger.
try:
functionInM
logger.
except:
logger.
but i get error:
[error] script [ log_1 ] stopped with error in line 15
[error] AttributeError ( 'str' object has no attribute 'level' )
[error] --- Traceback --- error source first line: module ( function ) statement 1319: __init__ ( callHandlers ) if record.levelno >= hdlr.level:
1280: __init__ ( handle ) self.callHandle
1270: __init__ ( _log ) self.handle(record)
1151: __init__ ( info ) self._log(INFO, msg, args, **kwargs)
[error] --- Traceback --- end --------------
What should i do ?
thanks for the help!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask linmiaoling for more information if necessary.