(self, record)
| 22 | msg = "%(message)s" |
| 23 | |
| 24 | def format(self, record): |
| 25 | if record.levelno == logging.DEBUG: |
| 26 | mcl, mtxt = self._color_dbg, "DBG" |
| 27 | elif record.levelno == logging.WARNING: |
| 28 | mcl, mtxt = self._color_warn, "WRN" |
| 29 | elif record.levelno == logging.ERROR: |
| 30 | mcl, mtxt = self._color_err, "ERR" |
| 31 | else: |
| 32 | mcl, mtxt = self._color_normal, "" |
| 33 | |
| 34 | if mtxt: |
| 35 | mtxt += " " |
| 36 | |
| 37 | if self.log_fout: |
| 38 | self.__set_fmt(self.date_full + mtxt + self.msg) |
| 39 | formatted = super(LogFormatter, self).format(record) |
| 40 | # self.log_fout.write(formatted) |
| 41 | # self.log_fout.write('\n') |
| 42 | # self.log_fout.flush() |
| 43 | return formatted |
| 44 | |
| 45 | self.__set_fmt(self._color_date(self.date) + mcl(mtxt + self.msg)) |
| 46 | formatted = super(LogFormatter, self).format(record) |
| 47 | |
| 48 | return formatted |
| 49 | |
| 50 | if sys.version_info.major < 3: |
| 51 |
no test coverage detected