Skip to content

Commit

Permalink
remove stacktraces from LOGGER.warn lines for fixing #1 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
kortemik authored Jun 2, 2023
1 parent c117ea2 commit 0a2e2b0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/com/teragrep/rlo_12/DirectoryEventWatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,20 @@ public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) throws IO

@Override
public FileVisitResult visitFileFailed(Path path, IOException exc) {
LOGGER.warn("visitFileFailed <[{}]> is not accessible, skipping due to:", path, exc);
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("visitFileFailed <[{}]> is not accessible, skipping due to <{}>", path, exc.getMessage());
}

return FileVisitResult.CONTINUE;
}

@Override
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
LOGGER.trace("postVisitDirectory <[{}]>", dir);
if (exc != null) {
LOGGER.warn("Directory <[{}]> caused:", dir, exc);
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("Directory <[{}]> caused <{}>", dir, exc.getMessage());
}
return FileVisitResult.SKIP_SUBTREE;
} else {
return FileVisitResult.CONTINUE;
Expand Down

0 comments on commit 0a2e2b0

Please sign in to comment.