4

I'm using sikuli-script.jar in my java application. It writes a lot of logging messages in the console. So, I want to disable logging or change the logging level. How I can do this? What logging library is used there and how it can be configured?

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
NullPointer
  • 924
  • 14
  • 27

5 Answers5

2

I run some Sikuli script a few times and never noticed any verbose output. I think you can override it by passing to the JVM an option like this:

-Dsikuli.Debug=ERROR

or

-Dsikuli.Debug=0

This is an untested answer. You'll have to try it yourself.

djangofan
  • 28,471
  • 61
  • 196
  • 289
  • Debug=0 doesn't work. It disables info messages when Debug=-2. This is pretty strange behavior. http://code.google.com/p/liuyn/source/browse/trunk/Sikuli-script/src/main/java/edu/mit/csail/uid/Debug.java – NullPointer Jan 16 '13 at 20:57
2

If you're using Java, you may want to check out Sikuli-API instead. It tries to be more of a standard Java library.

Sikuli-API uses SLF4J, so you just connect it to whatever logging framework you use (I like Logback a lot), and it will use that configuration.

Nathaniel Waisbrot
  • 23,261
  • 7
  • 71
  • 99
2

You can include this line in your script at the top to disable action logs like mouse click logs on stdout :D

Settings.ActionLogs=0
Prateek Bhuwania
  • 755
  • 1
  • 8
  • 19
0

In the sikuli-java.jar, sikuli-basics allows access to some configurable options:

Settings.ActionLogs
Settings.InfoLogs

Either/both can be assigned false to disable logging.

Alternatively, Debug.setLogFile(filename) may be used to redirect output to a file rather than the stdout.

Good luck, sikuli-guy!

0

For Sikuli 1.1.0 under Mac OS X 10.11.5 and JDK 1.8, this is the only way I can suppress logging when running the script via CLI:

java -Dsikuli.Debug=-2 -jar /Applications/SikuliX.app/Contents/Java/sikulix.jar -r /path/to/your/test.sikuli

NOTE:

1) You have to set -Dsikuli.Debug to -2 to make it work (thanks @NullPointer)

2) You have to place -Dsikuli.Debug=-2 as a JVM option right after "java" instead of placing it at the end of the command

nybon
  • 8,894
  • 9
  • 59
  • 67