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
ConstructorsConstructorDescriptionLoggers(System.Logger logger) Loggers(System.Logger logger, System.Logger.Level level, Throwable cause) Creates an instance of aLoggersrecord class. -
Method Summary
Modifier and TypeMethodDescriptionatDebug()atError()atInfo()atTrace()atWarn()cause()Returns the value of thecauserecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.voidLog a messagevoidLog a messagelogger()Returns the value of theloggerrecord component.voidlogRequest(HttpRequest request, String body) Log an HTTP requestvoidlogResponse(HttpResponse<?> response) Log an HTTP responsefinal StringtoString()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
-