MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / CheckVlogArguments

Function CheckVlogArguments

rtpose_wrapper/scripts/cpp_lint.py:1708–1724  ·  view source on GitHub ↗

Checks that VLOG() is only used for defining a logging level. For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and VLOG(FATAL) are not. Args: filename: The name of the current file. clean_lines: A CleansedLines instance containing the file. linenum: The nu

(filename, clean_lines, linenum, error)

Source from the content-addressed store, hash-verified

1706
1707
1708def CheckVlogArguments(filename, clean_lines, linenum, error):
1709 """Checks that VLOG() is only used for defining a logging level.
1710
1711 For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
1712 VLOG(FATAL) are not.
1713
1714 Args:
1715 filename: The name of the current file.
1716 clean_lines: A CleansedLines instance containing the file.
1717 linenum: The number of the line to check.
1718 error: The function to call with any errors found.
1719 """
1720 line = clean_lines.elided[linenum]
1721 if Search(r'\bVLOG\((INFO|ERROR|WARNING|DFATAL|FATAL)\)', line):
1722 error(filename, linenum, 'runtime/vlog', 5,
1723 'VLOG() should be used with numeric verbosity level. '
1724 'Use LOG() if you want symbolic severity levels.')
1725
1726
1727# Matches invalid increment: *count++, which moves pointer instead of

Callers 1

ProcessLineFunction · 0.85

Calls 2

SearchFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected