← Back to team overview

sikuli-driver team mailing list archive

[Question #234105]: How to catch the Sikuli keyboard interrupt Alt+Shift+C

 

New question #234105 on Sikuli:
https://answers.launchpad.net/sikuli/+question/234105

I want to know how to catch the Sikuli keyboard interrupt Alt+Shift+C for logging. This would allow me to close the logging file if I kill the Sikuli program with the keyboard interrupt. 

I use the following to start and stop logging:

def startLogging(logger, hdlr, logName):
    # used to initialize & format a logfile for this module
    logger.addHandler(hdlr)
    logger.setLevel(logging.INFO)
    formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
    hdlr.setFormatter(formatter)
    logger.info("***** START: " + logName)
    return

def stopLogging(logger, hdlr, logName):
    # use to gracefully shutdown the logfile for this module
    logger.info("***** END: " + logName+"\n")
    logger.removeHandler(hdlr)
    hdlr.flush()
    hdlr.close()
    return

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.