diff options
author | Benoit Lamarche <benoitlamarche@google.com> | 2014-11-21 16:51:06 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-11-21 16:51:07 +0000 |
commit | c9be1c224cdbd52aa34aab203199d62fca16f296 (patch) | |
tree | de8afc2161eaef535c6acb6b0792db1e60d340a2 | |
parent | 5722ead07d539b2fc739a616bcd7b69aaa9d4742 (diff) | |
parent | 1eb87cfb879f189272e6da89123592f3ea94b847 (diff) | |
download | toolchain_jack-c9be1c224cdbd52aa34aab203199d62fca16f296.zip toolchain_jack-c9be1c224cdbd52aa34aab203199d62fca16f296.tar.gz toolchain_jack-c9be1c224cdbd52aa34aab203199d62fca16f296.tar.bz2 |
Merge "Disable logs in Error, Warning and Info verbose levels" into ub-jack
-rw-r--r-- | jack/rsc/error.jack.logging.properties | 5 | ||||
-rw-r--r-- | jack/rsc/info.jack.logging.properties | 11 | ||||
-rw-r--r-- | jack/rsc/warning.jack.logging.properties | 9 | ||||
-rw-r--r-- | jack/src/com/android/jack/Options.java | 13 | ||||
-rw-r--r-- | jack/src/com/android/jack/reporting/SdkReporter.java | 2 | ||||
-rw-r--r-- | jack/tests/com/android/jack/errorhandling/JackFormatErrorTest.java | 10 |
6 files changed, 19 insertions, 31 deletions
diff --git a/jack/rsc/error.jack.logging.properties b/jack/rsc/error.jack.logging.properties index 8ee1196..3384be7 100644 --- a/jack/rsc/error.jack.logging.properties +++ b/jack/rsc/error.jack.logging.properties @@ -25,7 +25,4 @@ java.util.logging.ConsoleHandler.level= FINEST java.util.logging.ConsoleHandler.formatter= com.android.sched.util.log.ConsoleFormatter # Default level for loggers -.level= SEVERE - - - +.level= OFF diff --git a/jack/rsc/info.jack.logging.properties b/jack/rsc/info.jack.logging.properties index 08cd24d..3384be7 100644 --- a/jack/rsc/info.jack.logging.properties +++ b/jack/rsc/info.jack.logging.properties @@ -25,13 +25,4 @@ java.util.logging.ConsoleHandler.level= FINEST java.util.logging.ConsoleHandler.formatter= com.android.sched.util.log.ConsoleFormatter # Default level for loggers -.level= INFO - -# configure each logger -com.android.sched.level= SEVERE -org.reflections.level= SEVERE -com.google.inject.level= SEVERE -# ... - - - +.level= OFF diff --git a/jack/rsc/warning.jack.logging.properties b/jack/rsc/warning.jack.logging.properties index 8ffa4c1..3384be7 100644 --- a/jack/rsc/warning.jack.logging.properties +++ b/jack/rsc/warning.jack.logging.properties @@ -25,11 +25,4 @@ java.util.logging.ConsoleHandler.level= FINEST java.util.logging.ConsoleHandler.formatter= com.android.sched.util.log.ConsoleFormatter # Default level for loggers -.level= SEVERE - -# configure each logger -com.android.jack.level= WARNING -com.android.sched.level= SEVERE -org.reflections.level= SEVERE -com.google.inject.level= SEVERE -# ... +.level= OFF diff --git a/jack/src/com/android/jack/Options.java b/jack/src/com/android/jack/Options.java index 4c9f571..a74be87 100644 --- a/jack/src/com/android/jack/Options.java +++ b/jack/src/com/android/jack/Options.java @@ -177,7 +177,10 @@ public class Options { protected final File propertiesFile = null; - enum VerbosityLevel { + /** + * Jack verbosity level + */ + public enum VerbosityLevel { ERROR("error"), WARNING("warning"), INFO("info"), DEBUG("debug"), TRACE("trace"); @Nonnull @@ -339,14 +342,14 @@ public class Options { "jack.internal.filter.method", "Define which filter will be used for methods", Filter.class).addDefaultValue("all-methods"); - // - // Getter - // - public VerbosityLevel getVerbosityLevel() { return verbose; } + public void setVerbosityLevel(@Nonnull VerbosityLevel verbose) { + this.verbose = verbose; + } + public boolean askForVersion() { return version; } diff --git a/jack/src/com/android/jack/reporting/SdkReporter.java b/jack/src/com/android/jack/reporting/SdkReporter.java index 14c903c..d2c35df 100644 --- a/jack/src/com/android/jack/reporting/SdkReporter.java +++ b/jack/src/com/android/jack/reporting/SdkReporter.java @@ -62,6 +62,6 @@ public class SdkReporter extends CommonReporter { } messageBuffer.append(MESSAGE_SEPARATOR); messageBuffer.append(message); - System.out.println(messageBuffer.toString()); + System.err.println(messageBuffer.toString()); } } diff --git a/jack/tests/com/android/jack/errorhandling/JackFormatErrorTest.java b/jack/tests/com/android/jack/errorhandling/JackFormatErrorTest.java index ff39378..1460c5f 100644 --- a/jack/tests/com/android/jack/errorhandling/JackFormatErrorTest.java +++ b/jack/tests/com/android/jack/errorhandling/JackFormatErrorTest.java @@ -19,6 +19,7 @@ package com.android.jack.errorhandling; import com.android.jack.JackAbortException; import com.android.jack.Main; import com.android.jack.Options; +import com.android.jack.Options.VerbosityLevel; import com.android.jack.TestTools; import com.android.jack.jayce.JayceProperties; import com.android.jack.library.FileType; @@ -71,6 +72,7 @@ public class JackFormatErrorTest { "public class B extends A {} \n"); Options options = new Options(); + options.setVerbosityLevel(VerbosityLevel.DEBUG); List<String> ecjArgs = new ArrayList<String>(); ecjArgs.add(ite.getTestingFolder().getAbsolutePath()); options.setEcjArguments(ecjArgs); @@ -86,7 +88,7 @@ public class JackFormatErrorTest { Assert.assertTrue(e.getCause() instanceof LibraryReadingException); Assert.assertTrue(e.getCause().getCause() instanceof LibraryFormatException); } finally { - Assert.assertTrue(ite.endErrRedirection().contains("is invalid")); + Assert.assertTrue(ite.endErrRedirection().contains("is an invalid library")); Assert.assertTrue(ite.endErrRedirection().contains( "Unexpected node NForStatement, NDeclaredType was expected")); } @@ -115,6 +117,7 @@ public class JackFormatErrorTest { "public class B extends A {} \n"); Options options = new Options(); + options.setVerbosityLevel(VerbosityLevel.DEBUG); List<String> ecjArgs = new ArrayList<String>(); ecjArgs.add(ite.getTestingFolder().getAbsolutePath()); options.setEcjArguments(ecjArgs); @@ -130,7 +133,7 @@ public class JackFormatErrorTest { Assert.assertTrue(e.getCause() instanceof LibraryReadingException); Assert.assertTrue(e.getCause().getCause() instanceof LibraryFormatException); } finally { - Assert.assertTrue(ite.endErrRedirection().contains("is invalid")); + Assert.assertTrue(ite.endErrRedirection().contains("is an invalid library")); Assert.assertTrue(ite.endErrRedirection().contains("Invalid Jayce header")); } } @@ -158,6 +161,7 @@ public class JackFormatErrorTest { "public class B extends A {} \n"); Options options = new Options(); + options.setVerbosityLevel(VerbosityLevel.DEBUG); List<String> ecjArgs = new ArrayList<String>(); ecjArgs.add(ite.getTestingFolder().getAbsolutePath()); options.setEcjArguments(ecjArgs); @@ -173,7 +177,7 @@ public class JackFormatErrorTest { Assert.assertTrue(e.getCause() instanceof LibraryReadingException); Assert.assertTrue(e.getCause().getCause() instanceof LibraryFormatException); } finally { - Assert.assertTrue(ite.endErrRedirection().contains("is invalid")); + Assert.assertTrue(ite.endErrRedirection().contains("is an invalid library")); Assert.assertTrue(ite.endErrRedirection().contains("Jayce version 0 not supported")); } } |