Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ release.

### Logs

- `SeverityNumber=0` MAY be used to represent an unspecified value.
([#4535](https://github.com/open-telemetry/opentelemetry-specification/pull/4535))

### Baggage

### Resource
Expand Down
2 changes: 2 additions & 0 deletions specification/logs/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ events. Larger numerical values in each range represent more important (more
severe) events. For example `SeverityNumber=17` describes an error that is less
critical than an error with `SeverityNumber=20`.

`SeverityNumber=0` MAY be used to represent an unspecified value.

#### Mapping of `SeverityNumber`

Mappings from existing logging systems and formats (or **source format** for
Expand Down
5 changes: 3 additions & 2 deletions specification/logs/supplementary-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ type SeverityProcessor struct {
// if the record's severity is greater than or equal to p.Min.
// Otherwise, the record is dropped (the wrapped processor is not invoked).
func (p *SeverityProcessor) OnEmit(ctx context.Context, record *sdklog.Record) error {
if record.Severity() != log.SeverityUndefined && record.Severity() < p.Min {
sev := record.Severity()
if sev >= log.SeverityTrace1 && sev <= log.SeverityFatal4 && sev < p.Min {
Comment thread
pellared marked this conversation as resolved.
Outdated
return nil
}
return p.Processor.OnEmit(ctx, record)
Comment thread
pellared marked this conversation as resolved.
Outdated
Expand All @@ -207,7 +208,7 @@ func (p *SeverityProcessor) OnEmit(ctx context.Context, record *sdklog.Record) e
// Enabled returns false if the severity is lower than p.Min.
func (p *SeverityProcessor) Enabled(ctx context.Context, param sdklog.EnabledParameters) bool {
sev := param.Severity
if sev != log.SeverityUndefined && sev < p.Min {
if sev >= log.SeverityTrace1 && sev <= log.SeverityFatal4 && sev < p.Min {
Comment thread
pellared marked this conversation as resolved.
Outdated
return false
}
if fp, ok := p.Processor.(sdklog.FilterProcessor); ok {
Expand Down
Loading