예제 #1
0
 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)
예제 #2
0
파일: plain.py 프로젝트: BabyDuncan/commons
 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)
예제 #3
0
 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)
예제 #4
0
파일: glog.py 프로젝트: BabyDuncan/commons
 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)