public static DaemonLog createInstance( File file, Applicable<? super OutputStream, ? extends ResourceProviderDefinition<? extends Handler>> loggingHandlerFactory) { ResourceProvider<OutputStream> streamProvider = ResourceProvider.of(new LogFileStreamProvider(file)); ResourceProvider<? extends Handler> handlerProvider = streamProvider.flatMap(loggingHandlerFactory); return new DaemonLog(handlerProvider, true, true); }
@Override public ResourceProvider<Handler> apply(final OutputStream stream) { return ResourceProvider.of(new FlushingHandlerResourceProvider(stream)); }