I have some python like this:
def foo(): logger = logging.getLogger() # do something here logger.debug(\'blah blah {}\'.format(expensive_func()))
You can use stringlike library to add laziness to your messages
stringlike
E.g.:
logger.debug( 'blah blah {value}' .format( value=LazyString(expensive_func) ) )
Lib link: https://github.com/CovenantEyes/py_stringlike