Skip to content

Commit

Permalink
Merge pull request #102 from jglick/FileMonitoringTask-logging
Browse files Browse the repository at this point in the history
Better logging for FileMonitoringTask.Watcher
  • Loading branch information
dwnusbaum authored Aug 5, 2019
2 parents 549a455 + 7bfff14 commit 93b86c9
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ private static class Watcher implements Runnable {
this.handler = handler;
this.listener = listener;
cs = FileMonitoringController.transcodingCharset(controller.charset);
LOGGER.log(Level.FINE, "remote transcoding charset: {0}", cs);
}

@Override public void run() {
Expand All @@ -491,7 +492,9 @@ private static class Watcher implements Runnable {
InputStream locallyEncodedStream = Channels.newInputStream(ch.position(lastLocation));
InputStream utf8EncodedStream = cs == null ? locallyEncodedStream : new ReaderInputStream(new InputStreamReader(locallyEncodedStream, cs), StandardCharsets.UTF_8);
handler.output(utf8EncodedStream);
lastLocationFile.write(Long.toString(ch.position()), null);
long newLocation = ch.position();
lastLocationFile.write(Long.toString(newLocation), null);
LOGGER.log(Level.FINE, "copied {0} bytes from {1}", new Object[] {newLocation - lastLocation, logFile});
}
}
if (exitStatus != null) {
Expand All @@ -501,6 +504,7 @@ private static class Watcher implements Runnable {
} else {
output = null;
}
LOGGER.log(Level.FINE, "exiting with code {0}", exitStatus);
handler.exited(exitStatus, output);
controller.cleanup(workspace);
} else {
Expand Down

0 comments on commit 93b86c9

Please sign in to comment.