Class DefaultLogger.NoopLogRecordBuilder
- java.lang.Object
-
- io.opentelemetry.api.logs.DefaultLogger.NoopLogRecordBuilder
-
- All Implemented Interfaces:
LogRecordBuilder
- Enclosing class:
- DefaultLogger
private static final class DefaultLogger.NoopLogRecordBuilder extends java.lang.Object implements LogRecordBuilder
-
-
Constructor Summary
Constructors Modifier Constructor Description private
NoopLogRecordBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
emit()
Emit the log record.<T> LogRecordBuilder
setAttribute(AttributeKey<T> key, T value)
Sets an attribute.LogRecordBuilder
setBody(Value<?> body)
Set the bodyValue
.LogRecordBuilder
setBody(java.lang.String body)
Set the body string.LogRecordBuilder
setContext(Context context)
Set the context.LogRecordBuilder
setObservedTimestamp(long timestamp, java.util.concurrent.TimeUnit unit)
Set the epochobservedTimestamp
, using the timestamp and unit.LogRecordBuilder
setObservedTimestamp(java.time.Instant instant)
Set theobservedTimestamp
, using the instant.LogRecordBuilder
setSeverity(Severity severity)
Set the severity.LogRecordBuilder
setSeverityText(java.lang.String severityText)
Set the severity text.LogRecordBuilder
setTimestamp(long timestamp, java.util.concurrent.TimeUnit unit)
Set the epochtimestamp
, using the timestamp and unit.LogRecordBuilder
setTimestamp(java.time.Instant instant)
Set the epochtimestamp
, using the instant.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.opentelemetry.api.logs.LogRecordBuilder
setAllAttributes
-
-
-
-
Method Detail
-
setTimestamp
public LogRecordBuilder setTimestamp(long timestamp, java.util.concurrent.TimeUnit unit)
Description copied from interface:LogRecordBuilder
Set the epochtimestamp
, using the timestamp and unit.The
timestamp
is the time at which the log record occurred. If unset, it will be set to the current time whenLogRecordBuilder.emit()
is called.- Specified by:
setTimestamp
in interfaceLogRecordBuilder
-
setTimestamp
public LogRecordBuilder setTimestamp(java.time.Instant instant)
Description copied from interface:LogRecordBuilder
Set the epochtimestamp
, using the instant.The
timestamp
is the time at which the log record occurred. If unset, it will be set to the current time whenLogRecordBuilder.emit()
is called.- Specified by:
setTimestamp
in interfaceLogRecordBuilder
-
setObservedTimestamp
public LogRecordBuilder setObservedTimestamp(long timestamp, java.util.concurrent.TimeUnit unit)
Description copied from interface:LogRecordBuilder
Set the epochobservedTimestamp
, using the timestamp and unit.The
observedTimestamp
is the time at which the log record was observed. If unset, it will be set to thetimestamp
.observedTimestamp
may be different fromtimestamp
if logs are being processed asynchronously (e.g. from a file or on a different thread).- Specified by:
setObservedTimestamp
in interfaceLogRecordBuilder
-
setObservedTimestamp
public LogRecordBuilder setObservedTimestamp(java.time.Instant instant)
Description copied from interface:LogRecordBuilder
Set theobservedTimestamp
, using the instant.The
observedTimestamp
is the time at which the log record was observed. If unset, it will be set to thetimestamp
.observedTimestamp
may be different fromtimestamp
if logs are being processed asynchronously (e.g. from a file or on a different thread).- Specified by:
setObservedTimestamp
in interfaceLogRecordBuilder
-
setContext
public LogRecordBuilder setContext(Context context)
Description copied from interface:LogRecordBuilder
Set the context.- Specified by:
setContext
in interfaceLogRecordBuilder
-
setSeverity
public LogRecordBuilder setSeverity(Severity severity)
Description copied from interface:LogRecordBuilder
Set the severity.- Specified by:
setSeverity
in interfaceLogRecordBuilder
-
setSeverityText
public LogRecordBuilder setSeverityText(java.lang.String severityText)
Description copied from interface:LogRecordBuilder
Set the severity text.- Specified by:
setSeverityText
in interfaceLogRecordBuilder
-
setBody
public LogRecordBuilder setBody(java.lang.String body)
Description copied from interface:LogRecordBuilder
Set the body string.Shorthand for calling
LogRecordBuilder.setBody(Value)
withValue.of(String)
.- Specified by:
setBody
in interfaceLogRecordBuilder
-
setBody
public LogRecordBuilder setBody(Value<?> body)
Description copied from interface:LogRecordBuilder
Set the bodyValue
.- Specified by:
setBody
in interfaceLogRecordBuilder
-
setAttribute
public <T> LogRecordBuilder setAttribute(AttributeKey<T> key, T value)
Description copied from interface:LogRecordBuilder
Sets an attribute.- Specified by:
setAttribute
in interfaceLogRecordBuilder
-
emit
public void emit()
Description copied from interface:LogRecordBuilder
Emit the log record.- Specified by:
emit
in interfaceLogRecordBuilder
-
-