MCPcopy Create free account
hub / github.com/alibaba/GraphScope / CheckVlogArguments

Function CheckVlogArguments

analytical_engine/misc/cpplint.py:2639–2655  ·  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

2637
2638
2639def CheckVlogArguments(filename, clean_lines, linenum, error):
2640 """Checks that VLOG() is only used for defining a logging level.
2641
2642 For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
2643 VLOG(FATAL) are not.
2644
2645 Args:
2646 filename: The name of the current file.
2647 clean_lines: A CleansedLines instance containing the file.
2648 linenum: The number of the line to check.
2649 error: The function to call with any errors found.
2650 """
2651 line = clean_lines.elided[linenum]
2652 if Search(r'\bVLOG\((INFO|ERROR|WARNING|DFATAL|FATAL)\)', line):
2653 error(filename, linenum, 'runtime/vlog', 5,
2654 'VLOG() should be used with numeric verbosity level. '
2655 'Use LOG() if you want symbolic severity levels.')
2656
2657# Matches invalid increment: *count++, which moves pointer instead of
2658# incrementing a value.

Callers 1

ProcessLineFunction · 0.85

Calls 1

SearchFunction · 0.85

Tested by

no test coverage detected