3 ms·
if logger.isEnabledFor(logging.DEBUG): logger.debug(f'{expensive_func()}')
by mixmastamyk 7y ago
if logger.isEnabledFor(logging.DEBUG):
logger.debug(f'{expensive_func()}')
- orf 7y agoI hope that’s a joke, because that is a verbose and ridiculous way of duplicating the work that the logging module does, while also making the code less readable and maintainable!
- mixmastamyk 7y agoThat’s how you defer an expensive function. The fstring part is the joke.