Skip to content

Commit

Permalink
Record GoDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Dec 27, 2023
1 parent f1713a6 commit 5ec6098
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions log/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"go.opentelemetry.io/otel/attribute"
)

// Record TODO: comment.
// Record represents a log record.
type Record struct {
Timestamp time.Time
ObservedTimestamp time.Time
Expand All @@ -23,32 +23,44 @@ type Record struct {
Attributes []attribute.KeyValue
}

// Severity TODO: comment.
// Severity represents a log record severity.
// Smaller numerical values correspond to less severe log records (such as debug events),
// larger numerical values correspond to more severe log records (such as errors and critical events).
type Severity int

// TODO: comment.
// Severity values defined by OpenTelemetry.
const (
SeverityUndefined Severity = iota
SeverityTrace
// A fine-grained debugging log record. Typically disabled in default configurations.
SeverityTrace Severity = 1
SeverityTrace2
SeverityTrace3
SeverityTrace4

// A debugging log record.
SeverityDebug
SeverityDebug2
SeverityDebug3
SeverityDebug4

// An informational log record. Indicates that an event happened.
SeverityInfo
SeverityInfo2
SeverityInfo3
SeverityInfo4

// A warning log record. Not an error but is likely more important than an informational event.
SeverityWarn
SeverityWarn2
SeverityWarn3
SeverityWarn4

// An error log record. Something went wrong.
SeverityError
SeverityError2
SeverityError3
SeverityError4

// A fatal log record such as application or system crash.
SeverityFatal
SeverityFatal2
SeverityFatal3
Expand Down

0 comments on commit 5ec6098

Please sign in to comment.