mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Replace root logger calls with module-specific loggers
This commit is contained in:
+5
-3
@@ -12,6 +12,8 @@ from core.data_store import DATA_STORE
|
||||
from core.status_reporter import StatusReporter
|
||||
from server.webserver import WEB_SERVER
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# Globals
|
||||
run = True
|
||||
|
||||
@@ -21,7 +23,7 @@ def shutdown(_signum=None, _frame=None):
|
||||
|
||||
global run
|
||||
|
||||
logging.info("Stopping program...")
|
||||
logger.info("Stopping program...")
|
||||
WEB_SERVER.stop()
|
||||
DATA_PROVIDERS.stop()
|
||||
CLEANUP_TIMER.stop()
|
||||
@@ -41,8 +43,8 @@ if __name__ == "__main__":
|
||||
root.handlers.clear()
|
||||
root.addHandler(handler)
|
||||
|
||||
logging.info("Starting...")
|
||||
logging.info(f"This is Spothole version {SOFTWARE_VERSION}. This instance is run by {SERVER_OWNER_CALLSIGN}.")
|
||||
logger.info("Starting...")
|
||||
logger.info(f"This is Spothole version {SOFTWARE_VERSION}. This instance is run by {SERVER_OWNER_CALLSIGN}.")
|
||||
|
||||
# Shut down gracefully on SIGINT
|
||||
signal.signal(signal.SIGINT, shutdown)
|
||||
|
||||
Reference in New Issue
Block a user