Package com.oracle.coherence.common.base
Class Logger
- java.lang.Object
-
- com.oracle.coherence.common.base.Logger
-
public abstract class Logger extends Object
Logging API.- Since:
- 20.06
- Author:
- Aleks Seovic 2020.05.18
-
-
Field Summary
Fields Modifier and Type Field Description static intALWAYSSeverity 0 will always be logged.static intCONFIGSeverity 4 indicates configuration related log message.static intERRORSeverity 1 indicates an error.static intFINESeverity 5 indicates an essential debug message.static intFINERSeverity 6 indicates a non-essential debug message.static intFINESTSeverity 7 indicates a very low-level, non-essential debug message or a tracing message.static intINFOSeverity 3 indicates information that should likely be logged.static intWARNINGSeverity 2 indicates a warning.
-
Constructor Summary
Constructors Constructor Description Logger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidconfig(String sMessage)Log the specified message withCONFIGseverity.static voidconfig(String sMessage, Throwable e)Log the specified message and the exception stack trace withCONFIGseverity.static voidconfig(Throwable e)Log the specified exception information (message and stack trace) withCONFIGseverity.static voidconfig(Supplier<String> supplierMessage)Log the specified message withCONFIGseverity.static voidconfig(Supplier<String> supplierMessage, Throwable e)Log the specified message and the exception stack trace withCONFIGseverity.static voidentering(Class<?> clz, String sMethod, Object... params)Entry logging.static voiderr(String sMessage)Log the specified message withERRORseverity.static voiderr(String sMessage, Throwable e)Log the specified message and the exception stack trace withERRORseverity.static voiderr(Throwable e)Log the specified exception information (message and stack trace) withERRORseverity.static voiderr(Supplier<String> supplierMessage)Log the specified message withERRORseverity.static voiderr(Supplier<String> supplierMessage, Throwable e)Log the specified message and the exception stack trace withERRORseverity.static voidexiting(Class<?> clz, String sMethod)Exit logging.static voidexiting(Class<?> clz, String sMethod, Object result, Object... additionalInfo)Exit logging.static voidfine(String sMessage)Log the specified message withFINEseverity.static voidfine(String sMessage, Throwable e)Log the specified message and the exception stack trace withFINEseverity.static voidfine(Throwable e)Log the specified exception information (message and stack trace) withFINEseverity.static voidfine(Supplier<String> supplierMessage)Log the specified message withFINEseverity.static voidfine(Supplier<String> supplierMessage, Throwable e)Log the specified message and the exception stack trace withFINEseverity.static voidfiner(String sMessage)Log the specified message withFINERseverity.static voidfiner(String sMessage, Throwable e)Log the specified message and the exception stack trace withFINERseverity.static voidfiner(Throwable e)Log the specified exception information (message and stack trace) withFINERseverity.static voidfiner(Supplier<String> supplierMessage)Log the specified message withFINERseverity.static voidfiner(Supplier<String> supplierMessage, Throwable e)Log the specified message and the exception stack trace withFINERseverity.static voidfinest(String sMessage)Log the specified message withFINESTseverity.static voidfinest(String sMessage, Throwable e)Log the specified message and the exception stack trace withFINESTseverity.static voidfinest(Throwable e)Log the specified exception information (message and stack trace) withFINESTseverity.static voidfinest(Supplier<String> supplierMessage)Log the specified message withFINESTseverity.static voidfinest(Supplier<String> supplierMessage, Throwable e)Log the specified message and the exception stack trace withFINESTseverity.static voidinfo(String sMessage)Log the specified message withINFOseverity.static voidinfo(String sMessage, Throwable e)Log the specified message and the exception stack trace withINFOseverity.static voidinfo(Throwable e)Log the specified exception information (message and stack trace) withINFOseverity.static voidinfo(Supplier<String> supplierMessage)Log the specified message withINFOseverity.static voidinfo(Supplier<String> supplierMessage, Throwable e)Log the specified message and the exception stack trace withINFOseverity.static booleanisEnabled(int nSeverity)Returntrueif the specified severity level should be logged.static voidlog(String sMessage, int nSeverity)Log the specified message at the specified severity level.static voidlog(String sMessage, Throwable e, int nSeverity)Log the specified message and the exception stack trace at the specified severity level.static voidlog(Throwable e, int nSeverity)Log the specified exception information (message and stack trace) at the specified severity level.static voidlog(Supplier<String> supplierMessage, int nSeverity)Log the specified message at the specified severity level.static voidlog(Supplier<String> supplierMessage, Throwable e, int nSeverity)Log the specified message and the exception stack trace at the specified severity level.static voidout(String sMessage)Log the specified message withALWAYSseverity.static voidout(String sMessage, Throwable e)Log the specified message and the exception stack trace withALWAYSseverity.static voidout(Throwable e)Log the specified exception information (message and stack trace) withALWAYSseverity.static voidout(Supplier<String> supplierMessage)Log the specified message withALWAYSseverity.static voidout(Supplier<String> supplierMessage, Throwable e)Log the specified message and the exception stack trace withALWAYSseverity.static voidsetLoggingLevel(int nSeverity)Set the logging level.static voidthrowing(Class<?> clz, String sMethod, Throwable throwable, Object... additionalInfo)Throwable logging.static voidwarn(String sMessage)Log the specified message withWARNINGseverity.static voidwarn(String sMessage, Throwable e)Log the specified message and the exception stack trace withWARNINGseverity.static voidwarn(Throwable e)Log the specified exception information (message and stack trace) withWARNINGseverity.static voidwarn(Supplier<String> supplierMessage)Log the specified message withWARNINGseverity.static voidwarn(Supplier<String> supplierMessage, Throwable e)Log the specified message and the exception stack trace withWARNINGseverity.
-
-
-
Field Detail
-
ALWAYS
public static final int ALWAYS
Severity 0 will always be logged.- See Also:
- Constant Field Values
-
ERROR
public static final int ERROR
Severity 1 indicates an error.- See Also:
- Constant Field Values
-
WARNING
public static final int WARNING
Severity 2 indicates a warning.- See Also:
- Constant Field Values
-
INFO
public static final int INFO
Severity 3 indicates information that should likely be logged.- See Also:
- Constant Field Values
-
CONFIG
public static final int CONFIG
Severity 4 indicates configuration related log message.- See Also:
- Constant Field Values
-
FINE
public static final int FINE
Severity 5 indicates an essential debug message.- See Also:
- Constant Field Values
-
FINER
public static final int FINER
Severity 6 indicates a non-essential debug message.- See Also:
- Constant Field Values
-
FINEST
public static final int FINEST
Severity 7 indicates a very low-level, non-essential debug message or a tracing message.- See Also:
- Constant Field Values
-
-
Method Detail
-
isEnabled
public static boolean isEnabled(int nSeverity)
Returntrueif the specified severity level should be logged.- Parameters:
nSeverity- the severity level- Returns:
trueif the specified severity level should be logged;falseotherwise
-
log
public static void log(String sMessage, int nSeverity)
Log the specified message at the specified severity level.- Parameters:
sMessage- the message to lognSeverity- the severity level
-
log
public static void log(Supplier<String> supplierMessage, int nSeverity)
Log the specified message at the specified severity level. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be loggednSeverity- the severity level
-
log
public static void log(String sMessage, Throwable e, int nSeverity)
Log the specified message and the exception stack trace at the specified severity level.- Parameters:
sMessage- the message to loge- the exception to log the stack trace fornSeverity- the severity level
-
log
public static void log(Supplier<String> supplierMessage, Throwable e, int nSeverity)
Log the specified message and the exception stack trace at the specified severity level. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be loggede- the exception to log the stack trace fornSeverity- the severity level
-
log
public static void log(Throwable e, int nSeverity)
Log the specified exception information (message and stack trace) at the specified severity level.- Parameters:
e- the exception to lognSeverity- the severity level
-
out
public static void out(String sMessage)
Log the specified message withALWAYSseverity.- Parameters:
sMessage- the message to log
-
out
public static void out(Supplier<String> supplierMessage)
Log the specified message withALWAYSseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be logged
-
out
public static void out(String sMessage, Throwable e)
Log the specified message and the exception stack trace withALWAYSseverity.- Parameters:
sMessage- the message to loge- the exception to log the stack trace for
-
out
public static void out(Supplier<String> supplierMessage, Throwable e)
Log the specified message and the exception stack trace withALWAYSseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be loggede- the exception to log the stack trace for
-
out
public static void out(Throwable e)
Log the specified exception information (message and stack trace) withALWAYSseverity.- Parameters:
e- the exception to log
-
err
public static void err(String sMessage)
Log the specified message withERRORseverity.- Parameters:
sMessage- the message to log
-
err
public static void err(Supplier<String> supplierMessage)
Log the specified message withERRORseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be logged
-
err
public static void err(String sMessage, Throwable e)
Log the specified message and the exception stack trace withERRORseverity.- Parameters:
sMessage- the message to loge- the exception to log the stack trace for
-
err
public static void err(Supplier<String> supplierMessage, Throwable e)
Log the specified message and the exception stack trace withERRORseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be loggede- the exception to log the stack trace for
-
err
public static void err(Throwable e)
Log the specified exception information (message and stack trace) withERRORseverity.- Parameters:
e- the exception to log
-
warn
public static void warn(String sMessage)
Log the specified message withWARNINGseverity.- Parameters:
sMessage- the message to log
-
warn
public static void warn(Supplier<String> supplierMessage)
Log the specified message withWARNINGseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be logged
-
warn
public static void warn(String sMessage, Throwable e)
Log the specified message and the exception stack trace withWARNINGseverity.- Parameters:
sMessage- the message to loge- the exception to log the stack trace for
-
warn
public static void warn(Supplier<String> supplierMessage, Throwable e)
Log the specified message and the exception stack trace withWARNINGseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be loggede- the exception to log the stack trace for
-
warn
public static void warn(Throwable e)
Log the specified exception information (message and stack trace) withWARNINGseverity.- Parameters:
e- the exception to log
-
info
public static void info(String sMessage)
Log the specified message withINFOseverity.- Parameters:
sMessage- the message to log
-
info
public static void info(Supplier<String> supplierMessage)
Log the specified message withINFOseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be logged
-
info
public static void info(String sMessage, Throwable e)
Log the specified message and the exception stack trace withINFOseverity.- Parameters:
sMessage- the message to loge- the exception to log the stack trace for
-
info
public static void info(Supplier<String> supplierMessage, Throwable e)
Log the specified message and the exception stack trace withINFOseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be loggede- the exception to log the stack trace for
-
info
public static void info(Throwable e)
Log the specified exception information (message and stack trace) withINFOseverity.- Parameters:
e- the exception to log
-
config
public static void config(String sMessage)
Log the specified message withCONFIGseverity.- Parameters:
sMessage- the message to log
-
config
public static void config(Supplier<String> supplierMessage)
Log the specified message withCONFIGseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be logged
-
config
public static void config(String sMessage, Throwable e)
Log the specified message and the exception stack trace withCONFIGseverity.- Parameters:
sMessage- the message to loge- the exception to log the stack trace for
-
config
public static void config(Supplier<String> supplierMessage, Throwable e)
Log the specified message and the exception stack trace withCONFIGseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be loggede- the exception to log the stack trace for
-
config
public static void config(Throwable e)
Log the specified exception information (message and stack trace) withCONFIGseverity.- Parameters:
e- the exception to log
-
fine
public static void fine(String sMessage)
Log the specified message withFINEseverity.- Parameters:
sMessage- the message to log
-
fine
public static void fine(Supplier<String> supplierMessage)
Log the specified message withFINEseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be logged
-
fine
public static void fine(String sMessage, Throwable e)
Log the specified message and the exception stack trace withFINEseverity.- Parameters:
sMessage- the message to loge- the exception to log the stack trace for
-
fine
public static void fine(Supplier<String> supplierMessage, Throwable e)
Log the specified message and the exception stack trace withFINEseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be loggede- the exception to log the stack trace for
-
fine
public static void fine(Throwable e)
Log the specified exception information (message and stack trace) withFINEseverity.- Parameters:
e- the exception to log
-
finer
public static void finer(String sMessage)
Log the specified message withFINERseverity.- Parameters:
sMessage- the message to log
-
finer
public static void finer(Supplier<String> supplierMessage)
Log the specified message withFINERseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be logged
-
finer
public static void finer(String sMessage, Throwable e)
Log the specified message and the exception stack trace withFINERseverity.- Parameters:
sMessage- the message to loge- the exception to log the stack trace for
-
finer
public static void finer(Supplier<String> supplierMessage, Throwable e)
Log the specified message and the exception stack trace withFINERseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be loggede- the exception to log the stack trace for
-
finer
public static void finer(Throwable e)
Log the specified exception information (message and stack trace) withFINERseverity.- Parameters:
e- the exception to log
-
finest
public static void finest(String sMessage)
Log the specified message withFINESTseverity.- Parameters:
sMessage- the message to log
-
finest
public static void finest(Supplier<String> supplierMessage)
Log the specified message withFINESTseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be logged
-
finest
public static void finest(String sMessage, Throwable e)
Log the specified message and the exception stack trace withFINESTseverity.- Parameters:
sMessage- the message to loge- the exception to log the stack trace for
-
finest
public static void finest(Supplier<String> supplierMessage, Throwable e)
Log the specified message and the exception stack trace withFINESTseverity. The message is provided by theSupplier, which will only be evaluated if the messages should be logged at the specified severity level. This avoids potentially expensive message construction if the message isn't going to be logged.- Parameters:
supplierMessage- the supplier of the message to log; only evaluated if the specified severity level should be loggede- the exception to log the stack trace for
-
finest
public static void finest(Throwable e)
Log the specified exception information (message and stack trace) withFINESTseverity.- Parameters:
e- the exception to log
-
entering
public static void entering(Class<?> clz, String sMethod, Object... params)
Entry logging.- Parameters:
clz- the sourceClasssMethod- the source methodparams- zero or more parameters to log- Throws:
NullPointerException- if eitherclzorsMethodarenull- Since:
- 22.06
-
exiting
public static void exiting(Class<?> clz, String sMethod)
Exit logging.- Parameters:
clz- the sourceClasssMethod- the source method- Throws:
NullPointerException- if eitherclzorsMethodarenull- Since:
- 22.06
-
exiting
public static void exiting(Class<?> clz, String sMethod, Object result, Object... additionalInfo)
Exit logging.- Parameters:
clz- the sourceClasssMethod- the source methodresult- the result returned by the exiting methodadditionalInfo- zero or more additional state details at the time of exit- Throws:
NullPointerException- if eitherclzorsMethodarenull- Since:
- 22.06
-
throwing
public static void throwing(Class<?> clz, String sMethod, Throwable throwable, Object... additionalInfo)
Throwable logging.- Parameters:
clz- the sourceClasssMethod- the source methodthrowable- theExceptionbeing thrownadditionalInfo- zero or more additional state details at the time of exit- Throws:
NullPointerException- if any arguments arenull- Since:
- 22.06
-
setLoggingLevel
public static void setLoggingLevel(int nSeverity)
Set the logging level.- Parameters:
nSeverity- the severity level- Since:
- 22.09
-
-