stop the [log] comments?

Asked by Brad

I can't figure out how to suppress the [log] entries to the output stream while running. It seems it should be so simple and for some reason I can't get it, please help.

I am running the scripts from a windows command line (cmd to be precise) and I do use a lot of "print" commands to notify of progress and status etc.

I read through the docs and have these lines in my code...
Settings.DebugLogs = 0
Settings.UserLogs = 0
Settings.InfoLogs = 0
but no matter what number I assign, the [log] entries still show every click on the screen.

I thought I could originally use these for my output, but couldn't get it figured out, so instead I have a "Debug" boolean I set to true, and use many "if Debug: print <status or information here>" and when I get things working I just set the value false again.

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
RaiMan (raimund-hocke) said :
#1

use False instead of 0

(the docs could have helped: http://sikulix-2014.readthedocs.org/en/latest/index.html ;-)

Revision history for this message
Brad (blueoni) said :
#2

I tried that, and I've looked extensively through the docs trying to find the solution. Their examples are where I got the Settings.infoLogs = 0 as from what I read I was supposed to use 0 for off, and 1 to 7 for severity?
I have now put it to Setting.infoLogs = False and still no change.

So in my CMD window while the script is running, I still get the following output...
[log] CLICK on L{-970,519)@S(1)[-1680,317 1680x1050]
[log] App.focus Chrome(71916) #0
for two examples.

Is there an Import or something I'm missing? I have:
from datetime import datetime
from time import time
import shutil
import random
import ConfigParser

and then I have my Settings.xxx = yyy entries.

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

the relevant chapter for all aspects of SikuliX logging:
http://sikulix-2014.readthedocs.org/en/latest/scripting.html#writing-and-redirecting-log-and-debug-messages

BTW: might be a typo here
Setting.infoLogs = False

must be
Setting.InfoLogs = False # uppercase Info...

Revision history for this message
Brad (blueoni) said :
#4

Thanks RaiMan, that solved my question.

Revision history for this message
Brad (blueoni) said :
#5

That's a page I hadn't found... and it was Settings.ActionLogs = False is what I was missing, wasn't even Settings.InfoLogs after all.
Thanks for the clarification.