Methods Summary |
---|
public void | addAlertListener(org.gudy.azureus2.plugins.logging.LoggerAlertListener listener)
ILogAlertListener lg_listener = new ILogAlertListener() {
public void alertRaised(LogAlert alert) {
if (alert.err == null) {
int type;
if (alert.entryType == LogAlert.AT_INFORMATION) {
type = LoggerChannel.LT_INFORMATION;
} else if (alert.entryType == LogAlert.AT_WARNING) {
type = LoggerChannel.LT_WARNING;
} else {
type = LoggerChannel.LT_ERROR;
}
listener.alertLogged(type, alert.text, alert.repeatable);
} else
listener.alertLogged(alert.text, alert.err, alert.repeatable);
}
};
alert_listeners_map.put( listener, lg_listener );
org.gudy.azureus2.core3.logging.Logger.addListener( lg_listener );
|
public void | addFileLoggingListener(org.gudy.azureus2.plugins.logging.FileLoggerAdapter listener)
FileLogging fileLogging = org.gudy.azureus2.core3.logging.Logger.getFileLoggingInstance();
if (fileLogging == null)
return;
fileLogging.addListener(new PluginFileLoggerAdapater(fileLogging, listener));
|
public org.gudy.azureus2.plugins.logging.LoggerChannel | getChannel(java.lang.String name)
LoggerChannel channel = new LoggerChannelImpl( this, name, false, false );
channels.add( channel );
return( channel );
|
public org.gudy.azureus2.plugins.logging.LoggerChannel[] | getChannels()
LoggerChannel[] res = new LoggerChannel[channels.size()];
channels.toArray( res );
return( res );
|
public org.gudy.azureus2.plugins.logging.LoggerChannel | getNullChannel(java.lang.String name)
LoggerChannel channel = new LoggerChannelImpl( this, name, true, true );
channels.add( channel );
return( channel );
|
public org.gudy.azureus2.plugins.PluginInterface | getPluginInterface()
return( pi );
|
public org.gudy.azureus2.plugins.logging.LoggerChannel | getTimeStampedChannel(java.lang.String name)
LoggerChannel channel = new LoggerChannelImpl( this, name, true, false );
channels.add( channel );
return( channel );
|
public void | removeAlertListener(org.gudy.azureus2.plugins.logging.LoggerAlertListener listener)
ILogAlertListener lg_listener = (ILogAlertListener)alert_listeners_map.remove( listener );
if ( lg_listener != null ){
org.gudy.azureus2.core3.logging.Logger.removeListener( lg_listener );
}
|
public void | removeFileLoggingListener(org.gudy.azureus2.plugins.logging.FileLoggerAdapter listener)
FileLogging fileLogging = org.gudy.azureus2.core3.logging.Logger.getFileLoggingInstance();
if (fileLogging == null)
return;
// find listener and remove
Object[] listeners = fileLogging.getListeners().toArray();
for (int i = 0; i < listeners.length; i++) {
if (listeners[i] instanceof PluginFileLoggerAdapater) {
PluginFileLoggerAdapater l = (PluginFileLoggerAdapater) listeners[i];
if (l.listener == listener) {
fileLogging.removeListener(l);
}
}
}
|