@Override public void apply(final RedwoodConfiguration config, Redwood.RecordHandlerTree root) { root.addChild(new Redwood.FileHandler(config.defaultFile.getPath()){{ this.leftMargin = config.channelWidth; }}); } };
Redwood.rootHandler().addChild( RedirectOutputHandler.fromJavaUtilLogging(topLogger)); Redwood.log("Hello from Redwood -> Java!");
public RedwoodConfiguration listenOnChannels(Consumer<Redwood.Record> listener, Object... channels) { return this.handlers( Handlers.chain(new FilterHandler(Collections.singletonList(new LogFilter() { Set<Object> matchAgainst = new HashSet<>(Arrays.asList(channels)); @Override public boolean matches(Redwood.Record message) { for (Object channel : message.channels()) { if (matchAgainst.contains(channel)) { return true; } } return false; } }), true), (config, root) -> { root.addChild(new LogRecordHandler() { @Override public List<Redwood.Record> handle(Redwood.Record record) { listener.accept(record); return Collections.singletonList(record); } }); })); }
Redwood.rootHandler().addChild( RedirectOutputHandler.fromJavaUtilLogging(topLogger)); Redwood.log("Hello from Redwood -> Java!");
Redwood.rootHandler().addChild( RedirectOutputHandler.fromJavaUtilLogging(topLogger)); Redwood.log("Hello from Redwood -> Java!");
Redwood.rootHandler().addChild( RedirectOutputHandler.fromJavaUtilLogging(topLogger)); Redwood.log("Hello from Redwood -> Java!");
public RedwoodConfiguration listenOnChannels(Consumer<Redwood.Record> listener, Object... channels) { return this.handlers( Handlers.chain(new FilterHandler(Collections.singletonList(new LogFilter() { Set<Object> matchAgainst = new HashSet<>(Arrays.asList(channels)); @Override public boolean matches(Redwood.Record message) { for (Object channel : message.channels()) { if (matchAgainst.contains(channel)) { return true; } } return false; } }), true), (config, root) -> { root.addChild(new LogRecordHandler() { @Override public List<Redwood.Record> handle(Redwood.Record record) { listener.accept(record); return Collections.singletonList(record); } }); })); }
public RedwoodConfiguration listenOnChannels(Consumer<Redwood.Record> listener, Object... channels) { return this.handlers( Handlers.chain(new FilterHandler(Collections.singletonList(new LogFilter() { Set<Object> matchAgainst = new HashSet<>(Arrays.asList(channels)); @Override public boolean matches(Redwood.Record message) { for (Object channel : message.channels()) { if (matchAgainst.contains(channel)) { return true; } } return false; } }), true), (config, root) -> { root.addChild(new LogRecordHandler() { @Override public List<Redwood.Record> handle(Redwood.Record record) { listener.accept(record); return Collections.singletonList(record); } }); })); }
@Override public void apply(RedwoodConfiguration config, Redwood.RecordHandlerTree root) { Redwood.ConsoleHandler handler = Redwood.ConsoleHandler.out(); handler.leftMargin = config.channelWidth; root.addChild(handler); } };
@Override public void apply(final RedwoodConfiguration config, Redwood.RecordHandlerTree root) { root.addChild(new Redwood.FileHandler(config.defaultFile.getPath()){{ this.leftMargin = config.channelWidth; }}); } };
@Override public void apply(final RedwoodConfiguration config, Redwood.RecordHandlerTree root) { root.addChild(new Redwood.FileHandler(path){{ this.leftMargin = config.channelWidth; }}); } };
@Override public void apply(RedwoodConfiguration config, Redwood.RecordHandlerTree root) { config.outputHandler.leftMargin = config.channelWidth; root.addChild(config.outputHandler); } };
@Override public void apply(RedwoodConfiguration config,Redwood.RecordHandlerTree root) { Redwood.ConsoleHandler handler = Redwood.ConsoleHandler.err(); handler.leftMargin = config.channelWidth; root.addChild(handler); } };
@Override public void apply(final RedwoodConfiguration config, Redwood.RecordHandlerTree root) { root.addChild(new Redwood.FileHandler(config.defaultFile.getPath()){{ this.leftMargin = config.channelWidth; }}); } };
@Override public void apply(final RedwoodConfiguration config, Redwood.RecordHandlerTree root) { root.addChild(new Redwood.FileHandler(path){{ this.leftMargin = config.channelWidth; }}); } };
@Override public void apply(final RedwoodConfiguration config, Redwood.RecordHandlerTree root) { root.addChild(new Redwood.FileHandler(path){{ this.leftMargin = config.channelWidth; }}); } };
@Override public void apply(final RedwoodConfiguration config, Redwood.RecordHandlerTree root) { root.addChild(new Redwood.FileHandler(config.defaultFile.getPath()){{ this.leftMargin = config.channelWidth; }}); } };
@Override public void apply(final RedwoodConfiguration config, Redwood.RecordHandlerTree root) { root.addChild(new Redwood.FileHandler(path){{ this.leftMargin = config.channelWidth; }}); } };