Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 @Override
 public ResourceProvider<Handler> apply(final OutputStream stream) {
   return ResourceProvider.of(new FlushingHandlerResourceProvider(stream));
 }