From 84ddc247cce0cbdef408cfbd6cbe9653351a72fa Mon Sep 17 00:00:00 2001 From: Thomas Glamsch Date: Mon, 16 Oct 2017 20:42:23 +0200 Subject: [PATCH] Fix formatter of auto-installed logging handler. Formatter objects in Python 3.2+ support .format()-style format strings if constructed with the style parameter set to '{', but that was never backported to Python 2.7. --- vobject/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vobject/base.py b/vobject/base.py index e133e03..26a0d39 100644 --- a/vobject/base.py +++ b/vobject/base.py @@ -69,7 +69,7 @@ def to_basestring(s): logger = logging.getLogger(__name__) if not logging.getLogger().handlers: handler = logging.StreamHandler() - formatter = logging.Formatter('{name} {levelname} {message}') + formatter = logging.Formatter('%(name)s %(levelname)s %(message)s') handler.setFormatter(formatter) logger.addHandler(handler) logger.setLevel(logging.ERROR) # Log errors