@Test public void testLog() throws Exception { final Log log = new Log(LoggerFactory.getLogger(LogTest.class)); log.info("hello"); log.startUnitOfWork(); log.info("hello"); log.endUnitOfWork(); log.info("hello"); spawnThread(log.getContext()); log.endUnitOfWork(); log.endUnitOfWork(); log.endUnitOfWork(); log.info("hello {}", "Peter"); log.info("hello %s", "world"); log.info("hello {}, {}, {}", "he", "she", "it"); log.info("hello a {} {}", 100, "times"); log.info("Decent number formatting looks like this: %.4f", 1970.114284121232); log.info("Oh, an exception! {}", new RuntimeException("Panic!")); log.info(null); log.info(null, "Args get lost"); }
public Log(Logger logger) { this.logger = logger; this.isLocationAware = logger instanceof LocationAwareLogger; }
Log { public Log(Logger logger) { this.logger = logger; this.isLocationAware = logger instanceof LocationAwareLogger; } }
Log { public Log(Logger logger) { this.logger = logger; this.isLocationAware = logger instanceof LocationAwareLogger; } Log(Logger logger); }
Log { public Log(Logger logger) { this.logger = logger; this.isLocationAware = logger instanceof LocationAwareLogger; } Log(Logger logger); static Log mk(Class<?> clazz); void startUnitOfWork(); void endUnitOfWork(); void continueContext(Collection<String> init); static String getHumanReadableTimeString(long seconds); List<String> getContext(); void debug(String msg); void debug(String msg, Object... args); void info(String msg); void info(String msg, Object... args); void warn(String msg); void warn(String msg, Object... args); void warn(Throwable t, String msg); void error(String msg); void error(String msg, Object... args); void error(Throwable t, String msg, Object... args); }
Log { public Log(Logger logger) { this.logger = logger; this.isLocationAware = logger instanceof LocationAwareLogger; } Log(Logger logger); static Log mk(Class<?> clazz); void startUnitOfWork(); void endUnitOfWork(); void continueContext(Collection<String> init); static String getHumanReadableTimeString(long seconds); List<String> getContext(); void debug(String msg); void debug(String msg, Object... args); void info(String msg); void info(String msg, Object... args); void warn(String msg); void warn(String msg, Object... args); void warn(Throwable t, String msg); void error(String msg); void error(String msg, Object... args); void error(Throwable t, String msg, Object... args);  }