Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging formatting styles cleanup #14

Closed
jordens opened this issue Mar 25, 2015 · 3 comments
Closed

logging formatting styles cleanup #14

jordens opened this issue Mar 25, 2015 · 3 comments

Comments

@jordens
Copy link
Member

jordens commented Mar 25, 2015

The logging message formatting is a inconsistent. Let's do the following:

@sbourdeauducq
Copy link
Member

Did you get style="{" to work? I didn't. I also worry it may break compatibility with external modules (e.g. asyncio) that use old-style formatting.

@sbourdeauducq
Copy link
Member

This does not work:

import logging

logger = logging.getLogger('simple_example')
ch = logging.StreamHandler()
formatter = logging.Formatter(style="{")
ch.setFormatter(formatter)
logger.addHandler(ch)

logger.warn('warn message {0}', 42)

@jordens
Copy link
Member Author

jordens commented Mar 26, 2015

Ack. Looks broken. Then let's keep the "%" formatting for logging which then only requires changing comm_serial.py to use lazy formatting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants