Any way to turn off error logs?

Asked by aidma

Most logging functionality can be toggled using Settings.ActionLogs/DebugLogs/InfoLogs = 0, but is there a similar toggle for ErrorLogs?

I'm asking specifically because I'd like to suppress [error] logs for the code snippet below. But I'm also just curious to know if it's possible.

from datetime import datetime
def wait_for_focus(self, window_title, timeout=60):
        starttime = datetime.now()
        logger.info('Polling for focus on \'{}\...''.format(window_title))
        while True:
                <<<TURN ALL LOGGING OFF>>>
                focus= App.focus(window_title)
                <<<TURN IT BACK ON>>>
                if focus is not None:
                        logger.info('\'{}\' found and focused!'.format(window_title))
                        break
                if (datetime.now() - starttime).seconds > timeout:
                        raise Exception('Could not focus App %s' %window_title)
                sleep(1)

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
Best RaiMan (raimund-hocke) said :
#1
Revision history for this message
aidma (aidan-mahler13) said :
#2

Perfect! Redirecting logs is exactly what I need!

Revision history for this message
aidma (aidan-mahler13) said :
#3

Thanks RaiMan, that solved my question.