Skip to content

Commit 0a2e2b0

Browse files
authored
remove stacktraces from LOGGER.warn lines for fixing #1 (#9)
1 parent c117ea2 commit 0a2e2b0

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/main/java/com/teragrep/rlo_12/DirectoryEventWatcher.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,20 @@ public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IO
294294

295295
@Override
296296
public FileVisitResult visitFileFailed(Path path, IOException exc) {
297-
LOGGER.warn("visitFileFailed <[{}]> is not accessible, skipping due to:", path, exc);
297+
if (LOGGER.isWarnEnabled()) {
298+
LOGGER.warn("visitFileFailed <[{}]> is not accessible, skipping due to <{}>", path, exc.getMessage());
299+
}
300+
298301
return FileVisitResult.CONTINUE;
299302
}
300303

301304
@Override
302305
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
303306
LOGGER.trace("postVisitDirectory <[{}]>", dir);
304307
if (exc != null) {
305-
LOGGER.warn("Directory <[{}]> caused:", dir, exc);
308+
if (LOGGER.isWarnEnabled()) {
309+
LOGGER.warn("Directory <[{}]> caused <{}>", dir, exc.getMessage());
310+
}
306311
return FileVisitResult.SKIP_SUBTREE;
307312
} else {
308313
return FileVisitResult.CONTINUE;

0 commit comments

Comments
 (0)