Exclude sandbox/linux from SpamLogging check and restrict printf check.

1. Restrict the printf check to stdout / stderr

2. sandbox/linux uses printf and fprintf for good reason in a few places.
None of these would ever spam Chrome's stderr.

- Tests inside sandbox/linux have to run within their own small test
framework (so that they can run each in their own process). In this
framework, fprintf(stderr, XX) can be used to fail a test.

- The setuid sandbox is its own command line executable. It uses fprintf.

- A small number of tests (2), use fprintf to report kernel status while
running the test. It's extremely useful.

- The code generator in the BPF compiler was developped without base/
originally. It uses fprintf in a debug mode to print the assembled
program. This will only trigger on the equivalent of "compilation errors".

[email protected], [email protected]

Review URL: https://codereview.chromium.org/89073002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237624 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 370c057..0a9dae09 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -835,7 +835,8 @@
                 _TEST_CODE_EXCLUDED_PATHS +
                 input_api.DEFAULT_BLACK_LIST +
                 (r"^base[\\\/]logging\.h$",
-                 r"^remoting[\\\/]base[\\\/]logging\.h$",))
+                 r"^remoting[\\\/]base[\\\/]logging\.h$",
+                 r"^sandbox[\\\/]linux[\\\/].*",))
   source_file_filter = lambda x: input_api.FilterSourceFile(
       x, white_list=(file_inclusion_pattern,), black_list=black_list)
 
@@ -846,7 +847,7 @@
     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"\bf?printf\(", contents):
+    if re.search(r"\bf?printf\((stdout|stderr)", contents):
       printf.append(f.LocalPath())
 
   if log_info: