java.lang.Object
technology.sola.logging.SolaLogger
- Direct Known Subclasses:
JavaSolaLogger
SolaLogger instances are used to log messages to the console and/or files. SolaLogger must be configured via
configure(SolaLogLevel, SolaLoggerFactory)
before instances can be created via
of(Class)
. The log level of all logger instances will be the same based on how SolaLogger was
configured.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
configure
(SolaLogLevel level, SolaLoggerFactory solaLoggerFactory) Configures all resulting SolaLoggers to have desiredSolaLogLevel
and to be created via desiredSolaLoggerFactory
.void
Logs a message atSolaLogLevel.ERROR
.void
Logs a message atSolaLogLevel.ERROR
.void
Logs a message atSolaLogLevel.ERROR
.void
Logs a message atSolaLogLevel.INFO
.void
Logs a message atSolaLogLevel.INFO
.protected abstract void
log
(SolaLogLevel level, String message, @Nullable Throwable throwable, Object... params) Logs a message at desiredSolaLogLevel
.static SolaLogger
Utilizes the configuredSolaLoggerFactory
to create a newSolaLogger
instance for desired class.static SolaLogger
Utilizes the configuredSolaLoggerFactory
to create a newSolaLogger
instance for desired class.void
Logs a message atSolaLogLevel.WARNING
.void
Logs a message atSolaLogLevel.WARNING
.
-
Constructor Details
-
SolaLogger
public SolaLogger()
-
-
Method Details
-
configure
Configures all resulting SolaLoggers to have desiredSolaLogLevel
and to be created via desiredSolaLoggerFactory
.- Parameters:
level
- the log level for all logger instancessolaLoggerFactory
- the factory used to create new logger instances
-
of
Utilizes the configuredSolaLoggerFactory
to create a newSolaLogger
instance for desired class.- Parameters:
clazz
- the class to create a logger for- Returns:
- new logger instance
-
of
Utilizes the configuredSolaLoggerFactory
to create a newSolaLogger
instance for desired class. If theSolaLoggerFactory
creates instances that support writing to a file then the provided log file will be used to write to.- Parameters:
clazz
- the class to create a logger forlogFile
- the log file to write to- Returns:
- new logger instance
-
info
Logs a message atSolaLogLevel.INFO
.- Parameters:
message
- the message to log
-
info
Logs a message atSolaLogLevel.INFO
. This usesString.format(String, Object...)
to format the log message.- Parameters:
message
- the message to logparams
- the additional params for the log message
-
warning
Logs a message atSolaLogLevel.WARNING
.- Parameters:
message
- the message to log
-
warning
Logs a message atSolaLogLevel.WARNING
. This usesString.format(String, Object...)
to format the log message.- Parameters:
message
- the message to logparams
- the additional params for the log message
-
error
Logs a message atSolaLogLevel.ERROR
.- Parameters:
message
- the message to log
-
error
Logs a message atSolaLogLevel.ERROR
. Additionally, the passedThrowable
will be logged.- Parameters:
message
- the message to logthrowable
- the exception that should be logged
-
error
Logs a message atSolaLogLevel.ERROR
. This usesString.format(String, Object...)
to format the log message. Additionally, the passedThrowable
will be logged.- Parameters:
message
- the message to logthrowable
- the exception that should be loggedparams
- the additional params for the log message
-
log
protected abstract void log(SolaLogLevel level, String message, @Nullable Throwable throwable, Object... params) Logs a message at desiredSolaLogLevel
. This usesString.format(String, Object...)
to format the log message. Additionally, the passedThrowable
will be logged if provided.- Parameters:
level
- theSolaLogLevel
to log atmessage
- the message to logthrowable
- the exception that should be loggedparams
- the additional params for the log message
-