use Log instead of e.printStackTrace

This commit is contained in:
Doug MacEachern 2006-10-26 16:34:14 +00:00
parent b3e6cbf4e3
commit 1c909233b4
1 changed files with 6 additions and 2 deletions

View File

@ -44,6 +44,11 @@ public abstract class FileTail extends FileWatcher {
this.useSudo = useSudo;
}
private void error(String name, Throwable exc) {
String msg = name + ": " + exc.getMessage();
SigarLog.getLogger(FileTail.class.getName()).error(msg, exc);
}
public void onChange(FileInfo info) {
Reader reader = null;
String name = info.getName();
@ -60,8 +65,7 @@ public abstract class FileTail extends FileWatcher {
tail(info, reader);
setOffset(info);
} catch (IOException e) {
//XXX
e.printStackTrace();
error(name, e);
} finally {
if (reader != null) {
try { reader.close(); } catch (IOException e) { }