MCPcopy Index your code
hub / github.com/nodejs/node / CheckVlogArguments

Function CheckVlogArguments

tools/cpplint.py:2955–2976  ·  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. lin

(filename, clean_lines, linenum, error)

Source from the content-addressed store, hash-verified

2953
2954
2955def CheckVlogArguments(filename, clean_lines, linenum, error):
2956 """Checks that VLOG() is only used for defining a logging level.
2957
2958 For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
2959 VLOG(FATAL) are not.
2960
2961 Args:
2962 filename: The name of the current file.
2963 clean_lines: A CleansedLines instance containing the file.
2964 linenum: The number of the line to check.
2965 error: The function to call with any errors found.
2966 """
2967 line = clean_lines.elided[linenum]
2968 if re.search(r"\bVLOG\((INFO|ERROR|WARNING|DFATAL|FATAL)\)", line):
2969 error(
2970 filename,
2971 linenum,
2972 "runtime/vlog",
2973 5,
2974 "VLOG() should be used with numeric verbosity level. "
2975 "Use LOG() if you want symbolic severity levels.",
2976 )
2977
2978
2979# Matches invalid increment: *count++, which moves pointer instead of

Callers 1

ProcessLineFunction · 0.85

Calls 2

errorFunction · 0.50
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…