Commit 42191987 authored by Jonathan Michalon's avatar Jonathan Michalon

Flush stdout and add a timestamp when printing USR1-triggered status

Prints redirected to files are heavily cached, so we need to flush the
stream if we want to be able to read the output in log files as soon as
we return from signal handler.
parent f6ad809a
......@@ -45,8 +45,10 @@ def __create_report(only_old=False):
def __usr1_handler(signum, frame):
(report, err) = __create_report()
print ("Signal SIGUSR1 caught, printing state of checks.")
print ("Signal SIGUSR1 caught, printing state of checks. (%s)" %
datetime.now())
print (report)
sys.stdout.flush()
def __alarm_handler(signum, frame):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment