Skip to content

Commit

Permalink
Fix formatter of auto-installed logging handler.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
CruzR committed Oct 16, 2017
1 parent 9885d9f commit 84ddc24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vobject/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 84ddc24

Please sign in to comment.