Indeed -- though I think the larger question from Luke is whether or not we want to enforce a certain style of logging message (variable arguments vs formatting the string itself). Since there's nothing to stop users from formatting the string on one line and passing it to logging on the next, not to mention that I don't really see the performance benefit, I think this warning is silly and should be removed and people can log however they feel most comfortable. Just my $0.02.
On Mon, Oct 17, 2016 at 10:20 AM Andrew Phillips <[email protected]> wrote: > Perhaps I stand corrected! -- though I don't see where it actually says > this approach is preferred. In any case, the Python 3 docs explicitly > state > that the behavior is only maintained for backwards compatibility: > https://docs.python.org/3/howto/logging.html#logging-variable-data Ah, interesting! From [1], it appears that it's now possible to change the placeholder syntax so that the messages look somewhat more "modern". As far as I can tell, variable components of the log messages are still intended to be passed as arguments, though? So with the style change, the log message could look like this: logging.info("A message with a param: {}", param) Regards ap [1] https://docs.python.org/3/howto/logging-cookbook.html#formatting-styles
