KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I use logging facility for python 2.7.3. Documentation for this Python version say : the logging package pre-dates newer formatting options such as str.format() and string.Template. These newer formatting options are supported... I like 'new' format with curly braces. So i'm trying to do something like: log = logging.getLogger("some.logger") log.debug("format this message {0}", 1) And get error: TypeError: not all arguments converted during string formatting What I miss here? P.S. I don't want to use log.debug("format this message {0}".format(1)) because in this case the message is always being formatted regardless of logger level.
Tags (comma-separated)
Save Edits
Cancel