def decorate_logger_methods(logger):
 logger.findCaller = find_caller
 for key in LOGGER_KEYS:
  log_method = getattr(logger, key)
  log_method = decorate_log_method(log_method)
  setattr(logger, key, log_method)
 return logger

def decorate_logger_methods ( logger ) : logger . findCaller = find_caller for key in LOGGER_KEYS : log_method = getattr ( logger , key ) log_method = decorate_log_method ( log_method ) setattr ( logger , key , log_method ) return logger
decorate all the logger methods so all the keys in the extra dictionary are automatically prefixed with an underscore to avoid clashes with standard log record attributes .