use Log instead of e.printStackTrace
This commit is contained in:
parent
b3e6cbf4e3
commit
1c909233b4
@ -44,6 +44,11 @@ public abstract class FileTail extends FileWatcher {
|
|||||||
this.useSudo = useSudo;
|
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) {
|
public void onChange(FileInfo info) {
|
||||||
Reader reader = null;
|
Reader reader = null;
|
||||||
String name = info.getName();
|
String name = info.getName();
|
||||||
@ -60,8 +65,7 @@ public abstract class FileTail extends FileWatcher {
|
|||||||
tail(info, reader);
|
tail(info, reader);
|
||||||
setOffset(info);
|
setOffset(info);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
//XXX
|
error(name, e);
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
} finally {
|
||||||
if (reader != null) {
|
if (reader != null) {
|
||||||
try { reader.close(); } catch (IOException e) { }
|
try { reader.close(); } catch (IOException e) { }
|
||||||
|
Loading…
Reference in New Issue
Block a user