From 37c050bdbf07f390652f685ff927687d627be8f7 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Tue, 22 Dec 2020 08:02:21 +0100 Subject: [PATCH] Adaption to new logging --- __init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 65c7450..3df0207 100644 --- a/__init__.py +++ b/__init__.py @@ -31,8 +31,11 @@ import logging import serial import time -logger_name = 'SERIAL_INTERFACE' -logger = logging.getLogger(logger_name) +try: + from config import APP_NAME as ROOT_LOGGER_NAME +except ImportError: + ROOT_LOGGER_NAME = 'root' +logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__) class serial_interface(object):