Class DefaultLogger.NoopLogRecordBuilder
- All Implemented Interfaces:
LogRecordBuilder
- Enclosing class:
DefaultLogger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidemit()Emit the log record.<T> LogRecordBuildersetAttribute(AttributeKey<T> key, T value) Sets an attribute.Set the bodyValue.Set the body string.setContext(Context context) Set the context.setObservedTimestamp(long timestamp, TimeUnit unit) Set the epochobservedTimestamp, using the timestamp and unit.setObservedTimestamp(Instant instant) Set theobservedTimestamp, using the instant.setSeverity(Severity severity) Set the severity.setSeverityText(String severityText) Set the severity text.setTimestamp(long timestamp, TimeUnit unit) Set the epochtimestamp, using the timestamp and unit.setTimestamp(Instant instant) Set the epochtimestamp, using the instant.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LogRecordBuilder
setAllAttributes
-
Constructor Details
-
NoopLogRecordBuilder
private NoopLogRecordBuilder()
-
-
Method Details
-
setTimestamp
Description copied from interface:LogRecordBuilderSet the epochtimestamp, using the timestamp and unit.The
timestampis the time at which the log record occurred. If unset, it will be set to the current time whenLogRecordBuilder.emit()is called.- Specified by:
setTimestampin interfaceLogRecordBuilder
-
setTimestamp
Description copied from interface:LogRecordBuilderSet the epochtimestamp, using the instant.The
timestampis the time at which the log record occurred. If unset, it will be set to the current time whenLogRecordBuilder.emit()is called.- Specified by:
setTimestampin interfaceLogRecordBuilder
-
setObservedTimestamp
Description copied from interface:LogRecordBuilderSet the epochobservedTimestamp, using the timestamp and unit.The
observedTimestampis the time at which the log record was observed. If unset, it will be set to thetimestamp.observedTimestampmay be different fromtimestampif logs are being processed asynchronously (e.g. from a file or on a different thread).- Specified by:
setObservedTimestampin interfaceLogRecordBuilder
-
setObservedTimestamp
Description copied from interface:LogRecordBuilderSet theobservedTimestamp, using the instant.The
observedTimestampis the time at which the log record was observed. If unset, it will be set to thetimestamp.observedTimestampmay be different fromtimestampif logs are being processed asynchronously (e.g. from a file or on a different thread).- Specified by:
setObservedTimestampin interfaceLogRecordBuilder
-
setContext
Description copied from interface:LogRecordBuilderSet the context.- Specified by:
setContextin interfaceLogRecordBuilder
-
setSeverity
Description copied from interface:LogRecordBuilderSet the severity.- Specified by:
setSeverityin interfaceLogRecordBuilder
-
setSeverityText
Description copied from interface:LogRecordBuilderSet the severity text.- Specified by:
setSeverityTextin interfaceLogRecordBuilder
-
setBody
Description copied from interface:LogRecordBuilderSet the body string.Shorthand for calling
LogRecordBuilder.setBody(Value)withValue.of(String).- Specified by:
setBodyin interfaceLogRecordBuilder
-
setBody
Description copied from interface:LogRecordBuilderSet the bodyValue.- Specified by:
setBodyin interfaceLogRecordBuilder
-
setAttribute
Description copied from interface:LogRecordBuilderSets an attribute.- Specified by:
setAttributein interfaceLogRecordBuilder
-
emit
public void emit()Description copied from interface:LogRecordBuilderEmit the log record.- Specified by:
emitin interfaceLogRecordBuilder
-