sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #42094
Re: [Question #595513]: Blank log file when run from command line
Question #595513 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/595513
Description changed to:
***************************** possible solutions
Since you do not see anything in the logfile, you are using simple print statements for your "logging" and not the features as described here: http://sikulix-2014.readthedocs.io/en/latest/scripting.html#writing-and-redirecting-log-and-debug-messages (which is the kind of logging, as it is used in SikuliX).
the print statement's output in the standard goes to stdout, which in turn in the IDE is per default redirected to the message area.
see: http://sikulix-2014.readthedocs.io/en/latest/faq/010-command-line.html
and the option -c to start the IDE from a commandline and switch off the message box, so all print output goes to stdout (commandline), which in turn can be redirected to a file using > (as you already did for a scriptrun).
you might also use the print statement to directly print to a file:
fLog = open(fnameLog, "w")
print >> fLog, "print test"
fLog.close()
where fnameLog is a valid filename string, that might be formed using os.path.join()
all this is standard Python
------------------------------------------------------------------------------
hi kinda new at this and testing some log outputs. When using the IDE
with the Settings.LogTime the message area displays perfectly. When I
try to redirect that output to a simple txt it's a blank file, even the
default non-specificed "WorkingDir/SikuliLog.txt" is blank. any options
that I am missing?
EDIT: I should mention im using 1.1.0 for now on a WIN 10 machine
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.