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

allow new-style formatting strings? #6

Closed
nsheff opened this issue Apr 30, 2019 · 2 comments
Closed

allow new-style formatting strings? #6

nsheff opened this issue Apr 30, 2019 · 2 comments
Assignees

Comments

@nsheff
Copy link
Member

nsheff commented Apr 30, 2019

right now we're using old style string formatting, but the logging Formatter can accept new-style:

https://docs.python.org/3/library/logging.html#logging.Formatter

Should we make this possible here:

h.setFormatter(logging.Formatter(get_fmt(h), datefmt=datefmt))

@vreuter
Copy link
Member

vreuter commented Apr 30, 2019

I'm not sure what you mean; are you suggesting a change in implementation, or in usage? Right now throughout various project we mix usage of % and .format in the way in which we build messages, but it sounds like you're suggesting an implementation here. Is that so that we constrain our usages to a single style?

@nsheff
Copy link
Member Author

nsheff commented Apr 30, 2019

logging.Formatter accepts a 'style' arg, but this is not passed through in our code. I'm suggesting allowing a user to use new-style Formatters with logmuse.

@vreuter vreuter self-assigned this Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants