4 ms·
One thing I vastly dislike with them is that they are still expanded in logging, while they are not expanded when logging is using "the old way".
by heavenlyblue 7y ago
One thing I vastly dislike with them is that they are still expanded in logging, while they are not expanded when logging is using "the old way".
- Will_Do 7y agoWhat do you mean the old way? Will it print what foo is if I type logger.info("{foo=}")?
- zaphirplane 7y agoLogging.info(“%s %s”, name, country”) the string isn’t expanded if the logging is set to warn. While with your example the string is expanded then discarded
- falcor84 7y agoHow would you fix the issue without breaking existing semantics? The way I see it, it's a necessary price to pay, and I just continue to use c-style forming strings in logging.
- eru 7y agoThe clean way would be to introduce laziness. But yeah, can't do that in Python.