user debug statement doesnt work

Asked by Dan

Trying to use the user debug log as described in the SikuliX documentation. have the following lines in my script. (this is a copy and paste.)

Settings.UserLogs = True
Settings.UserLogPrefix = "user"
Settings.UserLogTime = True
Debug.setUserLogfile("C:\mylog.txt")

I get the following error when I try to execute:

[error] script [ myrvishome2 ] stopped with error in line 94
[error] AttributeError ( type object 'org.sikuli.basics.Debug' has no attribute 'setUserLogfile' )

line 94 is the last of the four lines above. I'm running IDE version 1.1.0 .
If I comment out that line, the script works fine (without the logs of course).
what am I doing wrong?

Dan

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Eugene S (shragovich) said :
#1

I think you should use setUserLogFile without the Debug class.

Revision history for this message
Dan (danbecker75) said :
#2

I tried the line:

setUserLogfile("C:\mylog.txt")

and after run, execution stops at that line with error message:

[error (8/5/15 11:54:26 PM)] script [ myrvishome2 ] stopped with error in line 94
[error (8/5/15 11:54:26 PM)] NameError ( name 'setUserLogfile' is not defined )

Revision history for this message
Eugene S (shragovich) said :
#3

Did you import sikuli library properly?

from sikuli import *

Revision history for this message
Best RaiMan (raimund-hocke) said :
#4

it must be:
Debug.setUserLogFile("C:\mylog.txt")

(... all camel-cased ;-)

... and
from sikuli import *
is only needed in imported scripts/modules

Revision history for this message
RaiMan (raimund-hocke) said :
#5

I have corrected the docs.

Revision history for this message
Dan (danbecker75) said :
#6

Thanks. I had tried a handful of permutations thinking it might be a doc issue, but I guess I missed that one.

Revision history for this message
Dan (danbecker75) said :
#7

Thanks RaiMan, that solved my question.