From: Michael Tremer Date: Sun, 5 Dec 2021 15:17:00 +0000 (+0000) Subject: logging: Use PACKAGE_* from configure X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b7aa412020e3fe61bed55052095dff476b66640a;p=people%2Fms%2Fwestferry.git logging: Use PACKAGE_* from configure Signed-off-by: Michael Tremer --- diff --git a/src/westferry/constants.py.in b/src/westferry/constants.py.in index 46b4de3..0e4d6c2 100644 --- a/src/westferry/constants.py.in +++ b/src/westferry/constants.py.in @@ -19,5 +19,8 @@ # # ############################################################################### +PACKAGE_NAME = "@PACKAGE_NAME@" +PACKAGE_VERSION = "@PACKAGE_VERSION@" + TEMPLATESDIR = "@templatesdir@" WEBROOTDIR = "@webrootdir@" diff --git a/src/westferry/logging.py b/src/westferry/logging.py index 337285d..7ed0caf 100644 --- a/src/westferry/logging.py +++ b/src/westferry/logging.py @@ -22,8 +22,10 @@ import logging import systemd.journal +from .constants import * + # Initialize root logger -log = logging.getLogger("westferry") +log = logging.getLogger(PACKAGE_NAME) log.propagate = False # Set logger into DEBUG mode by default @@ -31,6 +33,6 @@ log.setLevel(logging.DEBUG) # Enable logging to journald journal = systemd.journal.JournalHandler( - SYSLOG_IDENTIFIER=__name__, + SYSLOG_IDENTIFIER=PACKAGE_NAME, ) log.addHandler(journal)