MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / CheckVlogArguments

Function CheckVlogArguments

engine/3rdparty/tinyobjloader/deps/cpplint.py:1937–1953  ·  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

1935
1936
1937def CheckVlogArguments(filename, clean_lines, linenum, error):
1938 """Checks that VLOG() is only used for defining a logging level.
1939
1940 For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
1941 VLOG(FATAL) are not.
1942
1943 Args:
1944 filename: The name of the current file.
1945 clean_lines: A CleansedLines instance containing the file.
1946 linenum: The number of the line to check.
1947 error: The function to call with any errors found.
1948 """
1949 line = clean_lines.elided[linenum]
1950 if Search(r'\bVLOG\((INFO|ERROR|WARNING|DFATAL|FATAL)\)', line):
1951 error(filename, linenum, 'runtime/vlog', 5,
1952 'VLOG() should be used with numeric verbosity level. '
1953 'Use LOG() if you want symbolic severity levels.')
1954
1955# Matches invalid increment: *count++, which moves pointer instead of
1956# incrementing a value.

Callers 1

ProcessLineFunction · 0.85

Calls 2

SearchFunction · 0.85
errorFunction · 0.50

Tested by

no test coverage detected