MCPcopy Index your code
hub / github.com/KhronosGroup/Vulkan-Docs / setLogFile

Function setLogFile

scripts/reflib.py:59–77  ·  view source on GitHub ↗

Set the file handle to log either or both warnings and diagnostics to. - setDiag and setWarn are True if the corresponding handle is to be set. - filename is None for no logging, '-' for stdout, or a pathname.

(setDiag, setWarn, filename)

Source from the content-addressed store, hash-verified

57 return f'{msg} '
58
59def setLogFile(setDiag, setWarn, filename):
60 """Set the file handle to log either or both warnings and diagnostics to.
61
62 - setDiag and setWarn are True if the corresponding handle is to be set.
63 - filename is None for no logging, '-' for stdout, or a pathname."""
64 global diagFile, warnFile
65
66 if filename is None:
67 return
68
69 if filename == '-':
70 fp = sys.stdout
71 else:
72 fp = open(filename, 'w', encoding='utf-8')
73
74 if setDiag:
75 diagFile = fp
76 if setWarn:
77 warnFile = fp
78
79def logDiag(*args, **kwargs):
80 file = kwargs.pop('file', diagFile)

Callers 6

genvk.pyFile · 0.90
genRef.pyFile · 0.90
reflow.pyFile · 0.90
promote.pyFile · 0.85
findBalance.pyFile · 0.85
fixupRef.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected