Add -log-filter option to the zinc task

Review Request #2315 - Created June 3, 2015 and submitted

Eric Ayers
1612, 1631
fkorotkov, stuhood

Add the -log-filter option to the zinc task to perform the same function as -Tnowarnregex for the Compiler class used under jmake

Tested by putting my updated zinc jar into place in and updating pants.ini with:

+enabled: True
+args: [
+    '-fork-java',
+    '-log-filter', '.*X500.*',
+    '-java-only', '-C-encoding', '-CUTF-8',
+  ]

Then compiling the simple hello world target as modified in The lines containing the string X500 were omitted from the output.


  • 0
  • 1
  • 0
  • 1
Description From Last Updated
John Sirois
John Sirois
Eric Ayers
Eric Ayers
Fedor Korotkov
Eric Ayers
Eric Ayers
Review request changed

Status: Closed (submitted)

Change Summary:

Thanks John & Fedor. Commit 4aa6204

Stu Hood

src/scala/org/pantsbuild/zinc/Util.scala (Diff revision 3)

isFiltered being "by-name" will cause the message to be created multiple times if filters exist:
once for each existing filter
again if it is actually logged

Would suggest creating a lazy val in the body of log and logRaw for the message so that it is only created once.

  1. Er, to be clear: the issue is that 'message' is by-name in multiple places.