-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathattributes.go
41 lines (32 loc) · 1.07 KB
/
attributes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package sevtrace
import (
"go.opentelemetry.io/otel/attribute"
)
// WithSeverity returns an attribute.KeyValue for the given severity level.
func WithSeverity(severity int64) attribute.KeyValue {
return severityKey.Int64(severity)
}
// WithTrace returns an attribute.KeyValue for the Trace severity.
func WithTrace() attribute.KeyValue {
return WithSeverity(SeverityTrace)
}
// WithDebug returns an attribute.KeyValue for the Debug severity.
func WithDebug() attribute.KeyValue {
return WithSeverity(SeverityDebug)
}
// WithInfo returns an attribute.KeyValue for the Info severity.
func WithInfo() attribute.KeyValue {
return WithSeverity(SeverityInfo)
}
// WithWarn returns an attribute.KeyValue for the Warn severity.
func WithWarn() attribute.KeyValue {
return WithSeverity(SeverityWarn)
}
// WithError returns an attribute.KeyValue for the Error severity.
func WithError() attribute.KeyValue {
return WithSeverity(SeverityError)
}
// WithFatal returns an attribute.KeyValue for the Fatal severity.
func WithFatal() attribute.KeyValue {
return WithSeverity(SeverityFatal)
}