@Test public void setPath_shouldNotCreateAFileOrParentDirectory_whenBuildIsNotCalled() throws Exception { Path parent = tempFiles.createTempDirectoryThatDoesNotExist(); Path logFile = tempFiles.register(parent.resolve("log.txt")); assertFalse(Files.exists(parent)); assertFalse(Files.exists(logFile)); new OpsLoggerFactory() .setPath(logFile); assertFalse(Files.exists(parent)); assertFalse(Files.exists(logFile)); }
public OpsLoggerFactory setPath(Path path) { validateParametersForSetPath(path); clearCachedInstance(); logfilePath = Optional.of(path).map(Path::toAbsolutePath); loggerOutput = Optional.empty(); return this; }
OpsLoggerFactory { public OpsLoggerFactory setPath(Path path) { validateParametersForSetPath(path); clearCachedInstance(); logfilePath = Optional.of(path).map(Path::toAbsolutePath); loggerOutput = Optional.empty(); return this; } }
OpsLoggerFactory { public OpsLoggerFactory setPath(Path path) { validateParametersForSetPath(path); clearCachedInstance(); logfilePath = Optional.of(path).map(Path::toAbsolutePath); loggerOutput = Optional.empty(); return this; }  }
OpsLoggerFactory { public OpsLoggerFactory setPath(Path path) { validateParametersForSetPath(path); clearCachedInstance(); logfilePath = Optional.of(path).map(Path::toAbsolutePath); loggerOutput = Optional.empty(); return this; }  OpsLoggerFactory setDestination(PrintStream printStream); OpsLoggerFactory setPath(Path path); OpsLoggerFactory setStoreStackTracesInFilesystem(boolean store); OpsLoggerFactory setStackTraceStoragePath(Path directory); OpsLoggerFactory setErrorHandler(Consumer<Throwable> handler); @Deprecated OpsLoggerFactory setCorrelationIdSupplier(Supplier<Map<String,String>> supplier); OpsLoggerFactory setGlobalDiagnosticContextSupplier(DiagnosticContextSupplier supplier); OpsLoggerFactory setAsync(boolean async); @SuppressWarnings("unchecked") OpsLogger<T> build(); }
OpsLoggerFactory { public OpsLoggerFactory setPath(Path path) { validateParametersForSetPath(path); clearCachedInstance(); logfilePath = Optional.of(path).map(Path::toAbsolutePath); loggerOutput = Optional.empty(); return this; }  OpsLoggerFactory setDestination(PrintStream printStream); OpsLoggerFactory setPath(Path path); OpsLoggerFactory setStoreStackTracesInFilesystem(boolean store); OpsLoggerFactory setStackTraceStoragePath(Path directory); OpsLoggerFactory setErrorHandler(Consumer<Throwable> handler); @Deprecated OpsLoggerFactory setCorrelationIdSupplier(Supplier<Map<String,String>> supplier); OpsLoggerFactory setGlobalDiagnosticContextSupplier(DiagnosticContextSupplier supplier); OpsLoggerFactory setAsync(boolean async); @SuppressWarnings("unchecked") OpsLogger<T> build();  }