You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I read through the documentation site but did not find a single line of code mentioning about string format. So I assumed the basic concepts are the same. But when I go ahead and try it, things does not work as expected:
Python 3.6.5 (default, Mar 30 2018, 06:42:10)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license"for more information.
>>> import logging, sys, logbook
>>> logging.basicConfig(level=logging.DEBUG, stream=sys.stdout)
>>> logging.debug('Hi %s', 'world')
DEBUG:root:Hi world
>>> logbook.StreamHandler(sys.stdout).push_application()
>>> logbook.debug('Hi %s', 'world')
[2018-06-09 13:01:12.360139] DEBUG: Generic: Hi %s
>>> logbook.__version__
'1.4.0'
>>> logbook.debug('Hi {}', 'world')
[2018-06-09 13:02:14.765765] DEBUG: Generic: Hi world
>>>
It seems like logbook does not support string format placeholders %s, %d, etc., while the stdlib logging does. It's this an intended behavior? If so, would it make sense to document this difference so people coming from logging could adjust their expectation?
The text was updated successfully, but these errors were encountered:
The code you attached is using logging redirect, which is mostly an interoperability feature to make sure built-in logging logs will make their way into logbook. If you use Logbook, your own code should emit logs using logbook loggers and not logging ones...
I read through the documentation site but did not find a single line of code mentioning about string format. So I assumed the basic concepts are the same. But when I go ahead and try it, things does not work as expected:
It seems like logbook does not support string format placeholders
%s
,%d
, etc., while the stdliblogging
does. It's this an intended behavior? If so, would it make sense to document this difference so people coming fromlogging
could adjust their expectation?The text was updated successfully, but these errors were encountered: