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