public class AgoraLogger
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static boolean |
allLogsEnabled |
private static boolean |
debugEnabled |
private static boolean |
errorEnabled |
private static boolean |
infoEnabled |
private static java.util.logging.Logger |
logger |
private static boolean |
performanceLoggingEnabled |
private static boolean |
warnEnabled |
| Constructor and Description |
|---|
AgoraLogger() |
| Modifier and Type | Method and Description |
|---|---|
static void |
configureLogLevel(java.util.logging.Level level)
Configure log level.
|
static void |
debug(java.lang.String message)
Debug level log - output only in debug mode.
|
static void |
debug(java.lang.String format,
java.lang.Object... args)
Debug level log - optimized for delayed string concatenation.
|
static void |
enablePerformanceLogging(boolean enable)
Enable or disable performance logging.
|
static void |
error(java.lang.String message)
Error level log.
|
static void |
error(java.lang.String format,
java.lang.Object... args)
Error level log - optimized for delayed string concatenation.
|
static void |
error(java.lang.String message,
java.lang.Throwable throwable)
Error level log - includes exception information.
|
static void |
info(java.lang.String message)
Info level log.
|
static void |
info(java.lang.String format,
java.lang.Object... args)
Info level log - optimized for delayed string concatenation.
|
static boolean |
isDebugEnabled()
Check if the specified log level is enabled.
|
static boolean |
isErrorEnabled()
Check if the ERROR log level is enabled.
|
static boolean |
isInfoEnabled()
Check if the INFO log level is enabled.
|
static boolean |
isWarnEnabled()
Check if the WARN log level is enabled.
|
static void |
performance(java.lang.String operation,
long startTime)
Performance monitoring log.
|
static void |
setAllLogsEnabled(boolean enable)
Globally enable or disable all log outputs.
|
static void |
trace(java.lang.String methodName,
java.lang.Object... params)
Method call tracing - enabled only in debug mode.
|
static void |
warn(java.lang.String message)
Warning level log.
|
static void |
warn(java.lang.String format,
java.lang.Object... args)
Warning level log - optimized for delayed string concatenation.
|
private static final java.util.logging.Logger logger
private static volatile boolean allLogsEnabled
private static volatile boolean debugEnabled
private static volatile boolean infoEnabled
private static volatile boolean warnEnabled
private static volatile boolean errorEnabled
private static volatile boolean performanceLoggingEnabled
public static void configureLogLevel(java.util.logging.Level level)
level - the log level to configurepublic static void enablePerformanceLogging(boolean enable)
enable - true to enable performance logging, false to disable itpublic static void setAllLogsEnabled(boolean enable)
enable - false to disable all logs, true to re-enable them according to the configured
log level.public static void debug(java.lang.String message)
message - the message to logpublic static void debug(java.lang.String format,
java.lang.Object... args)
format - the format stringargs - the arguments to format the stringpublic static void info(java.lang.String message)
message - the message to logpublic static void info(java.lang.String format,
java.lang.Object... args)
format - the format stringargs - the arguments to format the stringpublic static void warn(java.lang.String message)
message - the message to logpublic static void warn(java.lang.String format,
java.lang.Object... args)
format - the format stringargs - the arguments to format the stringpublic static void error(java.lang.String message)
message - the message to logpublic static void error(java.lang.String format,
java.lang.Object... args)
format - the format stringargs - the arguments to format the stringpublic static void error(java.lang.String message,
java.lang.Throwable throwable)
message - the message to logthrowable - the throwable to logpublic static void performance(java.lang.String operation,
long startTime)
operation - the operation to logstartTime - the start time of the operationpublic static void trace(java.lang.String methodName,
java.lang.Object... params)
methodName - the method name to logparams - the parameters to logpublic static boolean isDebugEnabled()
public static boolean isInfoEnabled()
public static boolean isWarnEnabled()
public static boolean isErrorEnabled()