From de4d34cf498600ec99d551d8427350408e37d235 Mon Sep 17 00:00:00 2001 From: "giacomo.tanganelli@for.unipi.it" Date: Fri, 11 May 2018 16:15:13 +0200 Subject: [PATCH] server logging --- coapthon/server/coap.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/coapthon/server/coap.py b/coapthon/server/coap.py index 5a52102..150c17d 100644 --- a/coapthon/server/coap.py +++ b/coapthon/server/coap.py @@ -16,15 +16,18 @@ from coapthon.messages.request import Request from coapthon.messages.response import Response from coapthon.resources.resource import Resource from coapthon.serializer import Serializer -from coapthon.utils import Tree +from coapthon.utils import Tree, create_logging import collections __author__ = 'Giacomo Tanganelli' -logger = logging.getLogger(__name__) +if not os.path.isfile("logging.conf"): + create_logging() +logger = logging.getLogger(__name__) +logging.config.fileConfig("logging.conf", disable_existing_loggers=False) class CoAP(object): """