MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / set_log_file

Function set_log_file

imperative/python/megengine/logger.py:15–24  ·  view source on GitHub ↗

r"""Sets log output file. Args: fout: file-like object that supports write and flush, or string for the filename mode: specify the mode to open log file if *fout* is a string

(fout, mode="a")

Source from the content-addressed store, hash-verified

13
14
15def set_log_file(fout, mode="a"):
16 r"""Sets log output file.
17
18 Args:
19 fout: file-like object that supports write and flush, or string for the filename
20 mode: specify the mode to open log file if *fout* is a string
21 """
22 if isinstance(fout, str):
23 fout = open(fout, mode)
24 MegEngineLogFormatter.log_fout = fout
25
26
27class MegEngineLogFormatter(logging.Formatter):

Callers 1

mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected