Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Log {
- private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Log.class);
- private String stackTrace(Exception cause) {
- if (cause == null)
- return "";
- StringWriter sw = new StringWriter(1024);
- final PrintWriter pw = new PrintWriter(sw);
- cause.printStackTrace(pw);
- pw.flush();
- return sw.toString();
- }
- public void warn(Exception cause, String message) {
- String output = message + "\n" + stackTrace(cause);
- log.warn(output);
- }
- // debug(...), info(...), etc.
- }
Add Comment
Please, Sign In to add comment