From 18b466b9ae1beed3b6c960a8152046f7571a853b Mon Sep 17 00:00:00 2001 From: "jln@chromium.org" Date: Mon, 2 Dec 2013 22:01:37 +0000 Subject: Catch printf() in CheckSpamLogging R=maruel@chromium.org, thakis@chromium.org Review URL: https://codereview.chromium.org/99653004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238199 0039d316-1c4b-4281-b951-d872f2087c98 --- PRESUBMIT.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'PRESUBMIT.py') diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 15eaf64..414cee8 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: -- cgit v1.1