MCPcopy Create free account
hub / github.com/apache/mesos / CheckVlogArguments

Function CheckVlogArguments

support/cpplint.py:2150–2166  ·  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

2148
2149
2150def CheckVlogArguments(filename, clean_lines, linenum, error):
2151 """Checks that VLOG() is only used for defining a logging level.
2152
2153 For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
2154 VLOG(FATAL) are not.
2155
2156 Args:
2157 filename: The name of the current file.
2158 clean_lines: A CleansedLines instance containing the file.
2159 linenum: The number of the line to check.
2160 error: The function to call with any errors found.
2161 """
2162 line = clean_lines.elided[linenum]
2163 if Search(r'\bVLOG\((INFO|ERROR|WARNING|DFATAL|FATAL)\)', line):
2164 error(filename, linenum, 'runtime/vlog', 5,
2165 'VLOG() should be used with numeric verbosity level. '
2166 'Use LOG() if you want symbolic severity levels.')
2167
2168# Matches invalid increment: *count++, which moves pointer instead of
2169# incrementing a value.

Callers 1

ProcessLineFunction · 0.85

Calls 2

SearchFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected