I\'m using standard python logging module in my python application:
import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(\"log\") whi
If you depend only on accessing global state attributes, you can instantiate a python class and lazify it by using the __str__
method:
class get_lazy_debug(object):
def __repr__(self):
return ' '.join(
str(i) for i in range(20)
)
# Allows to pass get_lazy_debug as a function parameter without
# evaluating/creating its string!
get_lazy_debug = get_lazy_debug()
logger.debug( 'Stupid log message', get_lazy_debug )
Related: