public abstract class AbstractLogger extends Object implements Logger
SYSTEM_EOL
Constructor and Description |
---|
AbstractLogger()
This is the default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected String |
format(Object[] message)
Converts the provided message object array to string.
|
protected String |
format(Throwable throwable)
Converts the provided throwable to string.
|
protected String |
formatLogMessage(LogLevel level,
Object[] message,
Throwable throwable)
Converts the provided data to string.
|
LogLevel |
getLogLevel()
Returns the minimum log level.
|
protected void |
log(LogLevel level,
Object[] message,
Throwable throwable)
Logs the provided data.
|
void |
logDebug(Object[] message,
Throwable throwable)
Logs the provided data at the debug level.
|
void |
logError(Object[] message,
Throwable throwable)
Logs the provided data at the error level.
|
protected abstract void |
logImpl(LogLevel level,
Object[] message,
Throwable throwable)
Logs the provided data.
|
void |
logInfo(Object[] message,
Throwable throwable)
Logs the provided data at the info level.
|
void |
setLogLevel(LogLevel logLevel)
Sets the minimum log level.
|
protected String formatLogMessage(LogLevel level, Object[] message, Throwable throwable)
level
- The log levelmessage
- The message parts (may be null)throwable
- The throwable (may be null)protected String format(Object[] message)
message
- The message parts (may be null)protected String format(Throwable throwable)
throwable
- The throwable (may be null)public final void setLogLevel(LogLevel logLevel)
setLogLevel
in interface Logger
logLevel
- The log levelpublic final LogLevel getLogLevel()
getLogLevel
in interface Logger
public void logDebug(Object[] message, Throwable throwable)
public void logInfo(Object[] message, Throwable throwable)
public void logError(Object[] message, Throwable throwable)
protected void log(LogLevel level, Object[] message, Throwable throwable)
level
- The log levelmessage
- The message parts (may be null)throwable
- The error (may be null)Copyright © 2009–2020 fax4j. All rights reserved.