mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 22:24:23 +01:00
Using logging instead of print; added startup log message
This commit is contained in:
@@ -10,13 +10,15 @@ logger = Logger("Daemon")
|
||||
|
||||
|
||||
def handle_signals(signal_received, frame):
|
||||
print("Shutting down PISA...")
|
||||
logger.info("Shutting down PISA")
|
||||
# TODO: add code to close the db, free any resources, etc.
|
||||
|
||||
exit(0)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
logger.info("Starting PISA")
|
||||
|
||||
signal(SIGINT, handle_signals)
|
||||
signal(SIGTERM, handle_signals)
|
||||
signal(SIGQUIT, handle_signals)
|
||||
|
||||
Reference in New Issue
Block a user