From 749f8663c48cf100440ba51724542577e46c1b58 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Fri, 25 Nov 2016 18:53:25 -0800 Subject: [PATCH] Use a statically allocated logger by default --- socketio/server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/socketio/server.py b/socketio/server.py index 52e0f37..154aee4 100644 --- a/socketio/server.py +++ b/socketio/server.py @@ -7,6 +7,8 @@ from . import base_manager from . import packet from . import namespace +default_logger = logging.getLogger('socketio') + class Server(object): """A Socket.IO server. @@ -92,7 +94,7 @@ class Server(object): if not isinstance(logger, bool): self.logger = logger else: - self.logger = logging.getLogger('socketio') + self.logger = default_logger if not logging.root.handlers and \ self.logger.level == logging.NOTSET: if logger: