sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #08324
Re: [Question #180346]: Timestamp in logfile
Question #180346 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/180346
Jason D Tran posted a new comment:
Thanks! That resolved the issues.
What is your suggestion about write to a log file from multiple scripts?
As below example, the Suite script would call Create script, and I want
to able to write to log file within Create script also.
==========================
suite.sikuli
-----
from sikuli import*
import logging # once at beginning of script
reload(logging)
# initialization
myHandler = logging.FileHandler('/Users/fitlab/SikuliLog/new.txt')
myLog = logging.getLogger()
myLog.addHandler(myHandler)
myLog.setLevel(logging.DEBUG)
import Create
myLog.info('Calling Create script...')
Create.MyCreate()
# shutdown (a must in the IDE ! )
myHandler.close()
create.sikuli
---
from sikuli import *
def MyCreate():
openApp("Safari")
myLog.info("launch Safari")
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.