Record Class Loggers
java.lang.Object
java.lang.Record
org.mbari.vars.annosaurus.sdk.r1.etc.jdk.Loggers
- Record Components:
logger
- The logger to uselevel
- The logging levelcause
- The cause of the log message
public record Loggers(System.Logger logger, System.Logger.Level level, Throwable cause)
extends Record
Fluent API for logging. This is a simple wrapper around the Java 9+ System.Logger API. It
provides a fluent API for logging.
-
Constructor Summary
ConstructorDescriptionLoggers
(System.Logger logger) Loggers
(System.Logger logger, System.Logger.Level level, Throwable cause) Creates an instance of aLoggers
record class. -
Method Summary
Modifier and TypeMethodDescriptionatDebug()
atError()
atInfo()
atTrace()
atWarn()
cause()
Returns the value of thecause
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.level()
Returns the value of thelevel
record component.void
Log a messagevoid
Log a messagelogger()
Returns the value of thelogger
record component.void
logRequest
(HttpRequest request, String body) Log an HTTP requestvoid
logResponse
(HttpResponse<?> response) Log an HTTP responsefinal String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
atTrace
-
atDebug
-
atInfo
-
atWarn
-
atError
-
withCause
-
log
-
log
-
logResponse
Log an HTTP response- Parameters:
response
- The response to log
-
logRequest
Log an HTTP request- Parameters:
request
- The request to logbody
- The body of the request
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
logger
-
level
-
cause
-