def format(self, record): try: level = PlainFormatter.LEVEL_MAP[record.levelno] except: level = '?????' record_message = '%s] %s' % (level, format_message(record)) record.getMessage = lambda: record_message return logging.Formatter.format(self, record)
def format(self, record): try: level = GlogFormatter.LEVEL_MAP[record.levelno] except: level = '?' date = time.localtime(record.created) date_usec = (record.created - int(record.created)) * 1e6 record_message = '%c%02d%02d %02d:%02d:%02d.%06d %s %s:%d] %s' % ( level, date.tm_mon, date.tm_mday, date.tm_hour, date.tm_min, date.tm_sec, date_usec, record.process if record.process is not None else '?????', record.filename, record.lineno, format_message(record)) record.getMessage = lambda: record_message return logging.Formatter.format(self, record)