MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / format

Method format

utils/pyt_utils.py:21–45  ·  view source on GitHub ↗
(self, record)

Source from the content-addressed store, hash-verified

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

Callers 15

eval.pyFile · 0.45
mainFunction · 0.45
train.pyFile · 0.45
benchmark.pyFile · 0.45
get_2dshapeFunction · 0.45
infer.pyFile · 0.45
_color_dbgMethod · 0.45
_color_warnMethod · 0.45
_color_errMethod · 0.45
_color_omittedMethod · 0.45
_color_dateMethod · 0.45
load_restore_modelFunction · 0.45

Calls 2

__set_fmtMethod · 0.95
_color_dateMethod · 0.95

Tested by

no test coverage detected