Package com.biglybt.core.logging
Class Logger
- java.lang.Object
-
- com.biglybt.core.logging.Logger
-
public class Logger extends java.lang.Object
A static implementation of the LoggerImpl class.- Since:
- 2.3.0.7
-
-
Field Summary
Fields Modifier and Type Field Description private static boolean
closing_taking_too_long
private static FileLogging
fileLogging
private static LoggerImpl
loggerImpl
private static LogIDs
LOGID
-
Constructor Summary
Constructors Constructor Description Logger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addListener(ILogAlertListener aListener)
Add a listener that's triggered when an alert is logged.static void
addListener(ILogEventListener aListener)
Add a listener that's triggered when an event is logged.static void
allowLoggingToStdErr(boolean allowed)
static void
doRedirects()
Redirect stdout and stderr to Logger.static FileLogging
getFileLoggingInstance()
static java.io.PrintStream
getOldStdErr()
Retrieve the original stderr output before we hooked it.static boolean
isClosingTakingTooLong()
static boolean
isEnabled()
Determines whether events are loggedstatic void
log(LogAlert alert)
static void
log(LogEvent event)
Log an eventstatic void
logTextResource(LogAlert alert)
static void
logTextResource(LogAlert alert, java.lang.String[] params)
static void
logTextResource(LogEvent event)
Log an event, loading text from out messagebundle.static void
logTextResource(LogEvent event, java.lang.String[] params)
static void
removeListener(ILogAlertListener aListener)
Remove a previously added log listenerstatic void
removeListener(ILogEventListener aListener)
Remove a previously added log listenerstatic void
setClosing()
static void
setClosingTakingTooLong()
-
-
-
Field Detail
-
LOGID
private static final LogIDs LOGID
-
loggerImpl
private static LoggerImpl loggerImpl
-
fileLogging
private static final FileLogging fileLogging
-
closing_taking_too_long
private static volatile boolean closing_taking_too_long
-
-
Method Detail
-
isEnabled
public static boolean isEnabled()
Determines whether events are logged- Returns:
- true if events are logged
-
setClosing
public static void setClosing()
-
setClosingTakingTooLong
public static void setClosingTakingTooLong()
-
isClosingTakingTooLong
public static boolean isClosingTakingTooLong()
-
log
public static void log(LogEvent event)
Log an event- Parameters:
event
- event to log
-
log
public static void log(LogAlert alert)
-
logTextResource
public static void logTextResource(LogEvent event)
Log an event, loading text from out messagebundle. Fill event.text with resource id.- Parameters:
event
- event to log
-
logTextResource
public static void logTextResource(LogEvent event, java.lang.String[] params)
-
logTextResource
public static void logTextResource(LogAlert alert)
-
logTextResource
public static void logTextResource(LogAlert alert, java.lang.String[] params)
-
doRedirects
public static void doRedirects()
Redirect stdout and stderr to Logger.
-
addListener
public static void addListener(ILogEventListener aListener)
Add a listener that's triggered when an event is logged.- Parameters:
aListener
- Listener to call when an event is logged
-
addListener
public static void addListener(ILogAlertListener aListener)
Add a listener that's triggered when an alert is logged.- Parameters:
aListener
- Listener to call when an alert is logged
-
removeListener
public static void removeListener(ILogEventListener aListener)
Remove a previously added log listener- Parameters:
aListener
- Listener to remove
-
removeListener
public static void removeListener(ILogAlertListener aListener)
Remove a previously added log listener- Parameters:
aListener
- Listener to remove
-
getOldStdErr
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.- Returns:
- stderr
-
getFileLoggingInstance
public static FileLogging getFileLoggingInstance()
-
allowLoggingToStdErr
public static void allowLoggingToStdErr(boolean allowed)
-
-