Class LoggerImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.logging.LoggerImpl
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
LoggerImpl.PluginFileLoggerAdapater
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map
alert_listeners_map
private java.util.Map
alert_listeners_map2
private java.util.List
channels
private PluginInterface
pi
-
Constructor Summary
Constructors Constructor Description LoggerImpl(PluginInterface _pi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAlertListener(LogAlertListener listener)
Add a listener to be informed of any alerts to be displayed to users.void
addAlertListener(LoggerAlertListener listener)
Add LoggerAlertListener for all alerts raised.void
addFileLoggingListener(FileLoggerAdapter listener)
LoggerChannel
getChannel(java.lang.String name)
Create a normal logging channel.LoggerChannel[]
getChannels()
Retrieve all the channels that have been created for all plugins.LoggerChannel
getNullChannel(java.lang.String name)
Create a logger channel that doesn't output to the standard AZ log.PluginInterface
getPluginInterface()
Retrieve the PluginInterfaceLoggerChannel
getTimeStampedChannel(java.lang.String name)
Create a timestamped logging channel.void
removeAlertListener(LogAlertListener listener)
Remove a previously added alert listener.void
removeAlertListener(LoggerAlertListener listener)
Remove previously added AlertListener.void
removeFileLoggingListener(FileLoggerAdapter listener)
-
-
-
Field Detail
-
pi
private PluginInterface pi
-
channels
private java.util.List channels
-
alert_listeners_map
private java.util.Map alert_listeners_map
-
alert_listeners_map2
private java.util.Map alert_listeners_map2
-
-
Constructor Detail
-
LoggerImpl
public LoggerImpl(PluginInterface _pi)
-
-
Method Detail
-
getPluginInterface
public PluginInterface getPluginInterface()
Description copied from interface:Logger
Retrieve the PluginInterface- Specified by:
getPluginInterface
in interfaceLogger
- Returns:
- PluginInterface object
-
getChannel
public LoggerChannel getChannel(java.lang.String name)
Description copied from interface:Logger
Create a normal logging channel. Multiple calls to this method with the same name parameter results in different channels.- Specified by:
getChannel
in interfaceLogger
- Parameters:
name
- Name of LoggerChannel- Returns:
- a new LoggerChannel
-
getTimeStampedChannel
public LoggerChannel getTimeStampedChannel(java.lang.String name)
Description copied from interface:Logger
Create a timestamped logging channel. Multiple calls to this method with the same name parameter results in different channels.- Specified by:
getTimeStampedChannel
in interfaceLogger
- Parameters:
name
- Name of LoggerChannel- Returns:
- a new LoggerChannel
-
getNullChannel
public LoggerChannel getNullChannel(java.lang.String name)
Description copied from interface:Logger
Create a logger channel that doesn't output to the standard AZ log. Add listeners to it if output needs to be routed somewhere. Multiple calls to this method with the same name parameter results in different channels- Specified by:
getNullChannel
in interfaceLogger
- Parameters:
name
- Name of LoggerChannel- Returns:
- a new LoggerChannel
-
getChannels
public LoggerChannel[] getChannels()
Description copied from interface:Logger
Retrieve all the channels that have been created for all plugins.- Specified by:
getChannels
in interfaceLogger
- Returns:
- Array of LoggerChannel objects
-
addAlertListener
public void addAlertListener(LoggerAlertListener listener)
Description copied from interface:Logger
Add LoggerAlertListener for all alerts raised. It might be a better idea to useLogger.addAlertListener(LogAlertListener)
, as it is more flexible.- Specified by:
addAlertListener
in interfaceLogger
- Parameters:
listener
- Listener to add- See Also:
Logger.addAlertListener(LogAlertListener)
-
removeAlertListener
public void removeAlertListener(LoggerAlertListener listener)
Description copied from interface:Logger
Remove previously added AlertListener.- Specified by:
removeAlertListener
in interfaceLogger
- Parameters:
listener
- LoggerAlertListener to remove
-
addAlertListener
public void addAlertListener(LogAlertListener listener)
Description copied from interface:Logger
Add a listener to be informed of any alerts to be displayed to users.- Specified by:
addAlertListener
in interfaceLogger
-
removeAlertListener
public void removeAlertListener(LogAlertListener listener)
Description copied from interface:Logger
Remove a previously added alert listener.- Specified by:
removeAlertListener
in interfaceLogger
-
addFileLoggingListener
public void addFileLoggingListener(FileLoggerAdapter listener)
- Specified by:
addFileLoggingListener
in interfaceLogger
-
removeFileLoggingListener
public void removeFileLoggingListener(FileLoggerAdapter listener)
- Specified by:
removeFileLoggingListener
in interfaceLogger
-
-