Back to project page OHC-android.
The source code is released under:
MIT License
If you think the Android project OHC-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package io.openhc.ohc.logging; /* ww w. j a v a2 s . c om*/ import java.io.PrintWriter; import java.io.StringWriter; import java.util.logging.Level; import java.util.logging.Logger; public class OHC_Logger { private final Logger logger; public OHC_Logger(Logger logger) { this.logger = logger; } public void log(Level level, String str) { this.logger.log(level, str); } public void log(Level level, Exception ex) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ex.printStackTrace(pw); this.log(level, sw.toString()); } public void log(Level level, String str, Exception ex) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ex.printStackTrace(pw); this.log(level, String.format("%s\n%s", str, sw.toString())); } }