turn on native logging w/ -Dsigar.nativeLogging=true
This commit is contained in:
parent
6566dd7abd
commit
753d627296
|
@ -35,6 +35,9 @@ public class Sigar implements SigarProxy {
|
||||||
public static final String BUILD_DATE =
|
public static final String BUILD_DATE =
|
||||||
SigarVersion.BUILD_DATE;
|
SigarVersion.BUILD_DATE;
|
||||||
|
|
||||||
|
private static boolean enableLogging =
|
||||||
|
"true".equals(System.getProperty("sigar.nativeLogging"));
|
||||||
|
|
||||||
private static SigarLoader loader = new SigarLoader(Sigar.class);
|
private static SigarLoader loader = new SigarLoader(Sigar.class);
|
||||||
private FileSystemMap mounts = null;
|
private FileSystemMap mounts = null;
|
||||||
|
|
||||||
|
@ -102,9 +105,16 @@ public class Sigar implements SigarProxy {
|
||||||
try {
|
try {
|
||||||
open();
|
open();
|
||||||
} catch (SigarException e) {
|
} catch (SigarException e) {
|
||||||
//XXX log?
|
if (enableLogging) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
} catch (UnsatisfiedLinkError e) {
|
} catch (UnsatisfiedLinkError e) {
|
||||||
//XXX log?
|
if (enableLogging) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enableLogging) {
|
||||||
|
enableLogging(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue