MCPcopy
hub / github.com/KhronosGroup/Vulkan-Docs / logMsg

Method logMsg

scripts/generator.py:408–432  ·  view source on GitHub ↗

Write a message of different categories to different destinations. - `level` - 'diag' (diagnostic, voluminous) - 'warn' (warning) - 'error' (fatal error - raises exception after logging) - `*args` - print()-style arguments to direct to correspo

(self, level, *args)

Source from the content-addressed store, hash-verified

406 self.file_suffix = ''
407
408 def logMsg(self, level, *args):
409 """Write a message of different categories to different
410 destinations.
411
412 - `level`
413 - 'diag' (diagnostic, voluminous)
414 - 'warn' (warning)
415 - 'error' (fatal error - raises exception after logging)
416
417 - `*args` - print()-style arguments to direct to corresponding log"""
418 if level == 'error':
419 strfile = io.StringIO()
420 write('ERROR:', *args, file=strfile)
421 if self.errFile is not None:
422 write(strfile.getvalue(), file=self.errFile)
423 raise UserWarning(strfile.getvalue())
424 elif level == 'warn':
425 if self.warnFile is not None:
426 write('WARNING:', *args, file=self.warnFile)
427 elif level == 'diag':
428 if self.diagFile is not None:
429 write('DIAG:', *args, file=self.diagFile)
430 else:
431 raise UserWarning(
432 f"*** FATAL ERROR in Generator.logMsg: unknown level:{level}")
433
434 def enumToValue(self, elem, needsNum, bitwidth = 32,
435 forceSuffix = False, parent_for_alias_dereference=None):

Callers 15

enumToValueMethod · 0.95
checkDuplicateEnumsMethod · 0.95
deprecationCommentMethod · 0.95
buildEnumCDeclMethod · 0.95
buildEnumCDecl_EnumMethod · 0.95
makeDirMethod · 0.95
makeCParamDeclMethod · 0.95
getCParamTypeLengthMethod · 0.95
isStructAlwaysValidMethod · 0.95
isEnumRequiredMethod · 0.95
genRequirementsMethod · 0.80

Calls 1

writeFunction · 0.70

Tested by

no test coverage detected