MCPcopy Create free account
hub / github.com/BVLC/caffe / CheckVlogArguments

Function CheckVlogArguments

scripts/cpp_lint.py:1712–1728  ·  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

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

Callers 1

ProcessLineFunction · 0.85

Calls 1

SearchFunction · 0.85

Tested by

no test coverage detected