/** * Add handlers to Redwood. This is the main way to tell Redwood to do stuff. * Use this by calling a combination of methods in Handlers. It may be useful * to "import static RedwoodConfiguration.Handlers.*" * * For example: * <pre> * handlers(branch( * chain( hideDebug, collapseApproximate, branch( output, file("stderr.log") ), * chain( showOnlyError, file("err.log") ). * chain( showOnlyChannels("results", "evaluate"), file("results.log") ), * chain( file("redwood.log") ), * noop)) * </pre> * * @param paths A number of paths to add. * @return this */ public RedwoodConfiguration handlers(Thunk... paths) { for (final Thunk thunk : paths) { tasks.add(() -> thunk.apply(RedwoodConfiguration.this, Redwood.rootHandler())); } return this; }
Redwood.rootHandler().addChild( RedirectOutputHandler.fromJavaUtilLogging(topLogger)); Redwood.log("Hello from Redwood -> Java!");
@Override public void run() { thunk.apply(RedwoodConfiguration.this, Redwood.rootHandler()); } });
/** * Add handlers to Redwood. This is the main way to tell Redwood to do stuff. * Use this by calling a combination of methods in Handlers. It may be useful * to "import static RedwoodConfiguration.Handlers.*" * * For example: * <pre> * handlers(branch( * chain( hideDebug, collapseApproximate, branch( output, file("stderr.log") ), * chain( showOnlyError, file("err.log") ). * chain( showOnlyChannels("results", "evaluate"), file("results.log") ), * chain( file("redwood.log") ), * noop)) * </pre> * * @param paths A number of paths to add. * @return this */ public RedwoodConfiguration handlers(Thunk... paths) { for (final Thunk thunk : paths) { tasks.add(() -> thunk.apply(RedwoodConfiguration.this, Redwood.rootHandler())); } return this; }
/** * Add handlers to Redwood. This is the main way to tell Redwood to do stuff. * Use this by calling a combination of methods in Handlers. It may be useful * to "import static RedwoodConfiguration.Handlers.*" * * For example: * <pre> * handlers(branch( * chain( hideDebug, collapseApproximate, branch( output, file("stderr.log") ), * chain( showOnlyError, file("err.log") ). * chain( showOnlyChannels("results", "evaluate"), file("results.log") ), * chain( file("redwood.log") ), * noop)) * </pre> * * @param paths A number of paths to add. * @return this */ public RedwoodConfiguration handlers(Thunk... paths) { for (final Thunk thunk : paths) { tasks.add(() -> thunk.apply(RedwoodConfiguration.this, Redwood.rootHandler())); } return this; }
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!");