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 voidconfigure(SolaLogLevel level, SolaLoggerFactory solaLoggerFactory) Configures all resulting SolaLoggers to have desiredSolaLogLeveland to be created via desiredSolaLoggerFactory.voidLogs a message atSolaLogLevel.ERROR.voidLogs a message atSolaLogLevel.ERROR.voidLogs a message atSolaLogLevel.ERROR.voidLogs a message atSolaLogLevel.INFO.voidLogs a message atSolaLogLevel.INFO.protected abstract voidlog(SolaLogLevel level, String message, @Nullable Throwable throwable, Object... params) Logs a message at desiredSolaLogLevel.static SolaLoggerUtilizes the configuredSolaLoggerFactoryto create a newSolaLoggerinstance for desired class.static SolaLoggerUtilizes the configuredSolaLoggerFactoryto create a newSolaLoggerinstance for desired class.voidLogs a message atSolaLogLevel.WARNING.voidLogs a message atSolaLogLevel.WARNING.
-
Constructor Details
-
SolaLogger
public SolaLogger()
-
-
Method Details
-
configure
Configures all resulting SolaLoggers to have desiredSolaLogLeveland 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 configuredSolaLoggerFactoryto create a newSolaLoggerinstance for desired class.- Parameters:
clazz- the class to create a logger for- Returns:
- new logger instance
-
of
Utilizes the configuredSolaLoggerFactoryto create a newSolaLoggerinstance for desired class. If theSolaLoggerFactorycreates 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 passedThrowablewill 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 passedThrowablewill 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 passedThrowablewill be logged if provided.- Parameters:
level- theSolaLogLevelto log atmessage- the message to logthrowable- the exception that should be loggedparams- the additional params for the log message
-