@Test public void testAppendableLogger() { final Logger logger = Mockito.mock(Logger.class); final Formatter f = new Formatter(new AppendableLogger(logger, LogLevel.INFO)); f.format("%9s | %16s | %16s%n", "Data Type", "Export Supported", "Import Supported"); verify(logger).info("Data Type | Export Supported | Import Supported"); f.format("%9s | %16s | %16s%n", "portlet-type", true, true); verify(logger).info("portlet-type | true | true"); f.format("%9s | %16s | %16s%n", "portlet-definition", true, false); verify(logger).info("portlet-definition | true | false"); f.format("%9s | %16s | %16s%n", "layout", true, false); verify(logger).info(" layout | true | false"); verifyNoMoreInteractions(logger); }
public AppendableLogger(Logger logger, LogLevel appendLevel) { Validate.notNull(logger); this.logger = logger; this.loggingWriter = new LoggingWriter(logger, appendLevel); }
AppendableLogger implements Appendable, Logger { public AppendableLogger(Logger logger, LogLevel appendLevel) { Validate.notNull(logger); this.logger = logger; this.loggingWriter = new LoggingWriter(logger, appendLevel); } }
AppendableLogger implements Appendable, Logger { public AppendableLogger(Logger logger, LogLevel appendLevel) { Validate.notNull(logger); this.logger = logger; this.loggingWriter = new LoggingWriter(logger, appendLevel); } AppendableLogger(Logger logger, LogLevel appendLevel); }
AppendableLogger implements Appendable, Logger { public AppendableLogger(Logger logger, LogLevel appendLevel) { Validate.notNull(logger); this.logger = logger; this.loggingWriter = new LoggingWriter(logger, appendLevel); } AppendableLogger(Logger logger, LogLevel appendLevel); @Override Appendable append(CharSequence csq); @Override Appendable append(CharSequence csq, int start, int end); @Override Appendable append(char c); @Override String getName(); @Override boolean isTraceEnabled(); @Override void trace(String msg); @Override void trace(String format, Object arg); @Override void trace(String format, Object arg1, Object arg2); @Override void trace(String format, Object... argArray); @Override void trace(String msg, Throwable t); @Override boolean isTraceEnabled(Marker marker); @Override void trace(Marker marker, String msg); @Override void trace(Marker marker, String format, Object arg); @Override void trace(Marker marker, String format, Object arg1, Object arg2); @Override void trace(Marker marker, String format, Object... argArray); @Override void trace(Marker marker, String msg, Throwable t); @Override boolean isDebugEnabled(); @Override void debug(String msg); @Override void debug(String format, Object arg); @Override void debug(String format, Object arg1, Object arg2); @Override void debug(String format, Object... argArray); @Override void debug(String msg, Throwable t); @Override boolean isDebugEnabled(Marker marker); @Override void debug(Marker marker, String msg); @Override void debug(Marker marker, String format, Object arg); @Override void debug(Marker marker, String format, Object arg1, Object arg2); @Override void debug(Marker marker, String format, Object... argArray); @Override void debug(Marker marker, String msg, Throwable t); @Override boolean isInfoEnabled(); @Override void info(String msg); @Override void info(String format, Object arg); @Override void info(String format, Object arg1, Object arg2); @Override void info(String format, Object... argArray); @Override void info(String msg, Throwable t); @Override boolean isInfoEnabled(Marker marker); @Override void info(Marker marker, String msg); @Override void info(Marker marker, String format, Object arg); @Override void info(Marker marker, String format, Object arg1, Object arg2); @Override void info(Marker marker, String format, Object... argArray); @Override void info(Marker marker, String msg, Throwable t); @Override boolean isWarnEnabled(); @Override void warn(String msg); @Override void warn(String format, Object arg); @Override void warn(String format, Object... argArray); @Override void warn(String format, Object arg1, Object arg2); @Override void warn(String msg, Throwable t); @Override boolean isWarnEnabled(Marker marker); @Override void warn(Marker marker, String msg); @Override void warn(Marker marker, String format, Object arg); @Override void warn(Marker marker, String format, Object arg1, Object arg2); @Override void warn(Marker marker, String format, Object... argArray); @Override void warn(Marker marker, String msg, Throwable t); @Override boolean isErrorEnabled(); @Override void error(String msg); @Override void error(String format, Object arg); @Override void error(String format, Object arg1, Object arg2); @Override void error(String format, Object... argArray); @Override void error(String msg, Throwable t); @Override boolean isErrorEnabled(Marker marker); @Override void error(Marker marker, String msg); @Override void error(Marker marker, String format, Object arg); @Override void error(Marker marker, String format, Object arg1, Object arg2); @Override void error(Marker marker, String format, Object... argArray); @Override void error(Marker marker, String msg, Throwable t); }
AppendableLogger implements Appendable, Logger { public AppendableLogger(Logger logger, LogLevel appendLevel) { Validate.notNull(logger); this.logger = logger; this.loggingWriter = new LoggingWriter(logger, appendLevel); } AppendableLogger(Logger logger, LogLevel appendLevel); @Override Appendable append(CharSequence csq); @Override Appendable append(CharSequence csq, int start, int end); @Override Appendable append(char c); @Override String getName(); @Override boolean isTraceEnabled(); @Override void trace(String msg); @Override void trace(String format, Object arg); @Override void trace(String format, Object arg1, Object arg2); @Override void trace(String format, Object... argArray); @Override void trace(String msg, Throwable t); @Override boolean isTraceEnabled(Marker marker); @Override void trace(Marker marker, String msg); @Override void trace(Marker marker, String format, Object arg); @Override void trace(Marker marker, String format, Object arg1, Object arg2); @Override void trace(Marker marker, String format, Object... argArray); @Override void trace(Marker marker, String msg, Throwable t); @Override boolean isDebugEnabled(); @Override void debug(String msg); @Override void debug(String format, Object arg); @Override void debug(String format, Object arg1, Object arg2); @Override void debug(String format, Object... argArray); @Override void debug(String msg, Throwable t); @Override boolean isDebugEnabled(Marker marker); @Override void debug(Marker marker, String msg); @Override void debug(Marker marker, String format, Object arg); @Override void debug(Marker marker, String format, Object arg1, Object arg2); @Override void debug(Marker marker, String format, Object... argArray); @Override void debug(Marker marker, String msg, Throwable t); @Override boolean isInfoEnabled(); @Override void info(String msg); @Override void info(String format, Object arg); @Override void info(String format, Object arg1, Object arg2); @Override void info(String format, Object... argArray); @Override void info(String msg, Throwable t); @Override boolean isInfoEnabled(Marker marker); @Override void info(Marker marker, String msg); @Override void info(Marker marker, String format, Object arg); @Override void info(Marker marker, String format, Object arg1, Object arg2); @Override void info(Marker marker, String format, Object... argArray); @Override void info(Marker marker, String msg, Throwable t); @Override boolean isWarnEnabled(); @Override void warn(String msg); @Override void warn(String format, Object arg); @Override void warn(String format, Object... argArray); @Override void warn(String format, Object arg1, Object arg2); @Override void warn(String msg, Throwable t); @Override boolean isWarnEnabled(Marker marker); @Override void warn(Marker marker, String msg); @Override void warn(Marker marker, String format, Object arg); @Override void warn(Marker marker, String format, Object arg1, Object arg2); @Override void warn(Marker marker, String format, Object... argArray); @Override void warn(Marker marker, String msg, Throwable t); @Override boolean isErrorEnabled(); @Override void error(String msg); @Override void error(String format, Object arg); @Override void error(String format, Object arg1, Object arg2); @Override void error(String format, Object... argArray); @Override void error(String msg, Throwable t); @Override boolean isErrorEnabled(Marker marker); @Override void error(Marker marker, String msg); @Override void error(Marker marker, String format, Object arg); @Override void error(Marker marker, String format, Object arg1, Object arg2); @Override void error(Marker marker, String format, Object... argArray); @Override void error(Marker marker, String msg, Throwable t);  }