java.lang.Object
xyz.ronella.logging.LoggerPlus
Add functionality to logging.
- Since:
- 2019-11-27
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGroups logging output by name.static classDeprecated.Use GroupLogger instead. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAccepts a debug message.voidAccepts a String.format(ted) debug message.voidAccepts a supplier of a message.voidAccepts an error message.voidAccepts a String.format(ted) error message.voidAccepts a supplier of a message.org.slf4j.LoggerReturn the instance of the logger used.getStackTraceAsString(Exception exception) Capture the stacktrace as string from an exception.Return an instance of GroupLogger that can be used log messages by group.Return an instance of GroupLogger that can be used log messages by group.voidAccepts an info message.voidAccepts a String.format(ted) info message.voidAccepts a supplier of a message.logByMethodCall(String methodName) Deprecated.Use groupLog instead.logByMethodCall(String methodName, boolean withHeader) Deprecated.Use groupLog instead.voidAccept a trace message.voidAccepts a String.format(ted) trace message.voidAccepts a supplier of a message.voidAccepts a warning message.voidAccepts a String.format(ted) warn message.voidAccepts a supplier of a message.
-
Constructor Details
-
LoggerPlus
public LoggerPlus(org.slf4j.Logger logger) Creates an instance of LoggerPlus.- Parameters:
logger- Accepts an instance of Logger.
-
-
Method Details
-
getLogger
public org.slf4j.Logger getLogger()Return the instance of the logger used.- Returns:
- An instance of Logger.
-
debug
Accepts a debug message.- Parameters:
message- The message.
-
debug
Accepts a String.format(ted) debug message.- Parameters:
format- The format for the message.values- The values of the String.format(ted) message- Since:
- 1.2.0
-
debug
Accepts a supplier of a message.- Parameters:
message- The supplier of message.
-
info
Accepts an info message.- Parameters:
message- The info message.
-
info
Accepts a String.format(ted) info message.- Parameters:
format- The format for the message.values- The values of the String.format(ted) message- Since:
- 1.2.0
-
info
Accepts a supplier of a message.- Parameters:
message- The supplier of message.
-
error
Accepts an error message.- Parameters:
message- The error message.
-
error
Accepts a supplier of a message.- Parameters:
message- The supplier of message.
-
error
Accepts a String.format(ted) error message.- Parameters:
format- The format for the message.values- The values of the String.format(ted) message- Since:
- 1.2.0
-
warn
Accepts a warning message.- Parameters:
message- The warning message.
-
warn
Accepts a String.format(ted) warn message.- Parameters:
format- The format for the message.values- The values of the String.format(ted) message- Since:
- 1.2.0
-
warn
Accepts a supplier of a message.- Parameters:
message- The supplier of message.
-
trace
Accept a trace message.- Parameters:
message- The trace message.
-
trace
Accepts a String.format(ted) trace message.- Parameters:
format- The format for the message.values- The values of the String.format(ted) message- Since:
- 1.2.0
-
trace
Accepts a supplier of a message.- Parameters:
message- The supplier of message.
-
logByMethodCall
Deprecated.Use groupLog instead.Return an instance of MethodLogger that can be used log messages associated with the method.- Parameters:
methodName- The method name.withHeader- Place a log header message in each method class.- Returns:
- An instance of MethodLogger.
-
logByMethodCall
Deprecated.Use groupLog instead.Return an instance of MethodLogger that can be used log messages associated with the method.- Parameters:
methodName- The method name.- Returns:
- An instance of MethodLogger.
-
groupLog
Return an instance of GroupLogger that can be used log messages by group.- Parameters:
groupName- The group name.withHeader- Place a log header message with each group.- Returns:
- An instance of GroupLogger.
- Since:
- 1.1.0
-
groupLog
Return an instance of GroupLogger that can be used log messages by group.- Parameters:
groupName- The group name.- Returns:
- An instance of GroupLogger.
- Since:
- 1.1.0
-
getStackTraceAsString
Capture the stacktrace as string from an exception.- Parameters:
exception- An instance of exception.- Returns:
- The string equivalent of stacktrace.
-