Documentation ¶
Index ¶
Constants ¶
View Source
const ( // LogSeverityFieldName is the name of the log level field in New Relic logging JSON LogSeverityFieldName = "level" // LogMessageFieldName is the name of the log message field in New Relic logging JSON LogMessageFieldName = "message" // LogTimestampFieldName is the name of the timestamp field in New Relic logging JSON LogTimestampFieldName = "timestamp" // LogSpanIDFieldName is the name of the span ID field in the New Relic logging JSON LogSpanIDFieldName = "span.id" // LogTraceIDFieldName is the name of the trace ID field in the New Relic logging JSON LogTraceIDFieldName = "trace.id" // LogSeverityUnknown is the value the log severity should be set to if no log severity is known LogSeverityUnknown = "UNKNOWN" // number of bytes expected to be needed for the average log message AverageLogSizeEstimate = 400 )
Exported Constants for log decorators
Variables ¶
This section is empty.
Functions ¶
func ValidateDecoratedOutput ¶
func ValidateDecoratedOutput(t *testing.T, out *bytes.Buffer, expect *DecorationExpect)
ValidateDecoratedOutput is a testing tool that validates whether a bytes buffer decorated by a logcontext v2 decorator contains the values we expect it to.
Types ¶
type DecorationExpect ¶
type DecorationExpect struct { DecorationDisabled bool EntityGUID string EntityName string Hostname string TraceID string SpanID string // decorator errors will result in an undecorated log message being printed // and an error message also being printed in a separate line DecoratorError error }
DecorationExpect defines the expected values a log decorated by a logcontext v2 decorator should have
Click to show internal directories.
Click to hide internal directories.