Skip to content

Commit

Permalink
Add SeverityUndefined to otel/log (#5072)
Browse files Browse the repository at this point in the history
* Add SeverityUndefined

* Add changelog entry

---------

Co-authored-by: Sam Xie <sam@samxie.me>
  • Loading branch information
MrAlias and XSAM committed Mar 14, 2024
1 parent ca35244 commit 42c1708
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`. (#4906)
- Add `WithProxy` option in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlptracehttp`. (#4906)
- Add `SeverityUndefined` `const` to `go.opentelemetry.io/otel/log`.
This value represents an unset severity level. (#5072)

### Changed

Expand Down
3 changes: 3 additions & 0 deletions log/severity.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ type Severity int

// Severity values defined by OpenTelemetry.
const (
// SeverityUndefined represents an unset Severity.
SeverityUndefined Severity = 0 // UNDEFINED

// A fine-grained debugging log record. Typically disabled in default
// configurations.
SeverityTrace1 Severity = 1 // TRACE
Expand Down
8 changes: 4 additions & 4 deletions log/severity_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions log/severity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ func TestSeverity(t *testing.T) {
value int
str string
}{
{
name: "SeverityUndefined",
severity: log.SeverityUndefined,
value: 0,
str: "UNDEFINED",
},
{
name: "SeverityTrace",
severity: log.SeverityTrace,
Expand Down

0 comments on commit 42c1708

Please sign in to comment.