Logging settings where to change?

Asked by sandeep

Cant really understand where to add the logging settings as described in this document, which file should I add my logging statements in?
http://sikulix-2014.readthedocs.org/en/latest/scripting.html#writing-and-redirecting-log-and-debug-messages

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
sandeep
Solved:
Last query:
Last reply:

This question was reopened

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

Hi,

You can use these settings directly in your script as is.
Alternatively, if you import other scripts or configuration files into your main script, you can add these settings there as well.

Revision history for this message
sandeep (sbaldawa) said :
#2

Thanks again.
Appreciate the quick answers, I have used several automation tools in the past and started using Sikuli since past few days, must say it is v easy to use and I was able to automate in minutes.

Revision history for this message
sandeep (sbaldawa) said :
#3

I used the below settings and all sikuli logs show up pretty well, my question is wrt to user logs, how to I add them is it like log.info"Hello World"

Settings.UserLogs = True
Settings.UserLogPrefix = "user"
Settings.UserLogTime = True
Settings.LogTime = True
Settings.DebugLogs = True

Thanks

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

sorry to be a bit direct: did you read behind the mentioned link:

to write a user log message:
Debug.user("text with %placeholders", args …)
where text is a string according to the rules of Java String.format().
Information about Java String formatting can be found here
(rather formal, look for tutorials in the net additionally if this is new for you)
the messages look so:
[prefix optional-timestamp] message-text with filled in arg values
Being in Jython scripting one might as well use this:
Debug.user("some text with %placeholders" % (list-of-args …))

... it is all there as already mentioned in another answer to one of your posts.

Revision history for this message
sandeep (sbaldawa) said :
#5

Cool thanks. Sorry, I missed it.