Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: PRESUBMIT.py

Issue 99653004: Catch printf() in CheckSpamLogging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 15eaf642d901384bf100de782fce465603ef4bae..414cee8fe49ff67b01316bfd258887364262617b 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -849,9 +849,12 @@ def _CheckSpamLogging(input_api, output_api):
contents = input_api.ReadFile(f, 'rb')
if re.search(r"\bD?LOG\s*\(\s*INFO\s*\)", contents):
log_info.append(f.LocalPath())
- if re.search(r"\bD?LOG_IF\s*\(\s*INFO\s*,", contents):
+ elif re.search(r"\bD?LOG_IF\s*\(\s*INFO\s*,", contents):
log_info.append(f.LocalPath())
- if re.search(r"\bf?printf\((stdout|stderr)", contents):
+
+ if re.search(r"\bprintf\(", contents):
+ printf.append(f.LocalPath())
+ elif re.search(r"\bfprintf\((stdout|stderr)", contents):
printf.append(f.LocalPath())
if log_info:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698