Skip to content

Commit

Permalink
Issue GoogleCloudPlatform#295 - Cleanup debug/warning messages & javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
joakime committed Aug 25, 2016
1 parent 143dccf commit 846e4d2
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private static void appConfig(File configFile) {
logManager.reset(); // close & remove existing handlers, reset existing logger levels
logManager.readConfiguration(is);
} catch (SecurityException | IOException e) {
warning("Warning: caught exception when reading logging properties: %s", configFile
warning("Caught exception when reading logging properties: %s", configFile
.getAbsolutePath());
e.printStackTrace(System.err);
}
Expand All @@ -112,12 +112,37 @@ private static void systemConfig() throws IOException {
debug("Initialized %d SystemLogger(s)", count);
}

/**
* Non JUL debug logging.
* <p>
* As this class sets up the java.util.logging,
* we can't reliable start using logging yet.
* </p>
* <p>
* Note: by default this does not produce any output.
* Set the System.property {@code com.google.apphosting.logging.DEBUG} to
* true to see this output.
* </p>
*
* @param format the format of the debug line
* @param args the arguments of the debug line
*/
private static void debug(String format, Object... args) {
if (DEBUG) {
System.err.printf("[CoreLogging:DEBUG] " + format + "%n", args);
}
}

/**
* Non JUL warnings logging.
* <p>
* As this class sets up the java.util.logging,
* we can't reliable start using logging yet.
* </p>
*
* @param format the format of the debug line
* @param args the arguments of the debug line
*/
private static void warning(String format, Object... args) {
System.err.printf("[CoreLogging:WARNING] " + format + "%n", args);
}
Expand Down

0 comments on commit 846e4d2

Please sign in to comment.