Open jonyscathe opened 2 years ago
Hi,
I'm a bit confused by your example of how logging should be done for non-constant data.
I don't think your example in the readme works.
logger.info( "Hello {world}", extra=dict( world="Earth" ) )
Just leads to "Hello {world}" being logged as the extra dictionary is for filling in format arguments. So something like:
logging.basicConfig(format="%(message)s %(world)s") logger.info( "Hello", extra=dict( world="Earth" ) )
Will print out "Hello Earth", but obviously that isn't so useful for logging non-constant data that you don't want in every log message. Am I missing something in my logging config that allows the extra dict to be used as you suggest?
Hi,
I'm a bit confused by your example of how logging should be done for non-constant data.
I don't think your example in the readme works.
Just leads to "Hello {world}" being logged as the extra dictionary is for filling in format arguments. So something like:
Will print out "Hello Earth", but obviously that isn't so useful for logging non-constant data that you don't want in every log message. Am I missing something in my logging config that allows the extra dict to be used as you suggest?