Methods Summary |
---|
public static void | addListener(ILogAlertListener aListener)Add a listener that's triggered when an alert is logged.
loggerImpl.addListener(aListener);
|
public static void | addListener(ILogEventListener aListener)Add a listener that's triggered when an event is logged.
loggerImpl.addListener(aListener);
|
public static void | doRedirects()Redirect stdout and stderr to Logger.
loggerImpl.doRedirects();
|
public static org.gudy.azureus2.core3.logging.impl.FileLogging | getFileLoggingInstance()
return fileLogging;
|
public static java.io.PrintStream | getOldStdErr()Retrieve the original stderr output before we hooked it. Handy for
printing out critical errors that need to bypass the logger capture.
return loggerImpl.getOldStdErr();
|
public static boolean | isEnabled()Determines whether events are logged
try {
loggerImpl = new LoggerImpl();
loggerImpl.init();
fileLogging.initialize();
if (loggerImpl.isEnabled()) {
log(new LogEvent(LOGID, "**** Logging starts: "
+ Constants.AZUREUS_VERSION + " ****"));
log(new LogEvent(LOGID, "java.home=" + System.getProperty("java.home")));
log(new LogEvent(LOGID, "java.version="
+ System.getProperty("java.version")));
log(new LogEvent(LOGID, "os=" + System.getProperty("os.arch") + "/"
+ System.getProperty("os.name") + "/"
+ System.getProperty("os.version")));
log(new LogEvent(LOGID, "user.dir=" + System.getProperty("user.dir")));
log(new LogEvent(LOGID, "user.home=" + System.getProperty("user.home")));
}
} catch (Throwable t) {
t.printStackTrace();
Debug.out("Error initializing Logger", t);
// loggerImpl will always be set, except for cases where there wasn't
// enough memory. In that case, app will blork with null pointer exception
// on first Logger.* call. However, since there's not enough memory,
// application will probably blork somewhere else in the code first.
}
return loggerImpl.isEnabled();
|
public static void | log(LogEvent event)Log an event
loggerImpl.log(event);
|
public static void | log(LogAlert alert)
loggerImpl.log(alert);
|
public static void | logTextResource(LogEvent event)Log an event, loading text from out messagebundle. Fill event.text with
resource id.
loggerImpl.logTextResource(event);
|
public static void | logTextResource(LogEvent event, java.lang.String[] params)
loggerImpl.logTextResource(event, params);
|
public static void | logTextResource(LogAlert alert)
loggerImpl.logTextResource(alert);
|
public static void | logTextResource(LogAlert alert, java.lang.String[] params)
loggerImpl.logTextResource(alert, params);
|
public static void | removeListener(ILogEventListener aListener)Remove a previously added log listener
loggerImpl.removeListener(aListener);
|
public static void | removeListener(ILogAlertListener aListener)Remove a previously added log listener
loggerImpl.removeListener(aListener);
|