Skip to content

Commit

Permalink
[pkg/stanza] remove deprecated code (#33519)
Browse files Browse the repository at this point in the history
This change removes:

- adapter.LogEmitter, use helper.LogEmitter instead
- adapter.NewLogEmitter, use helper.NewLogEmitter instead
- fileconsumer.Manager's SugaredLogger struct member
- pipeline.DirectedPipeline's SugaredLogger struct member
- testutil.Logger, use zaptest.NewLogger instead

---------

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten authored Jun 12, 2024
1 parent d3873bb commit 5c765a3
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 35 deletions.
33 changes: 33 additions & 0 deletions .chloggen/codeboten_rm-deprecate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: stanza

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: remove deprecated code

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [33519]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext: |
This change removes:
- adapter.LogEmitter, use helper.LogEmitter instead
- adapter.NewLogEmitter, use helper.NewLogEmitter instead
- fileconsumer.Manager's SugaredLogger struct member
- pipeline.DirectedPipeline's SugaredLogger struct member
- testutil.Logger, use zaptest.NewLogger instead
# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [api]
19 changes: 0 additions & 19 deletions pkg/stanza/adapter/emitter.go

This file was deleted.

3 changes: 0 additions & 3 deletions pkg/stanza/fileconsumer/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ import (
)

type Manager struct {
// Deprecated [v0.101.0]
*zap.SugaredLogger

set component.TelemetrySettings
wg sync.WaitGroup
cancel context.CancelFunc
Expand Down
3 changes: 0 additions & 3 deletions pkg/stanza/pipeline/directed.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"sync"

"go.uber.org/multierr"
"go.uber.org/zap"
"gonum.org/v1/gonum/graph/encoding/dot"
"gonum.org/v1/gonum/graph/simple"
"gonum.org/v1/gonum/graph/topo"
Expand All @@ -26,8 +25,6 @@ var alreadyStopped = stanzaerrors.NewError("pipeline already stopped", "")

// DirectedPipeline is a pipeline backed by a directed graph
type DirectedPipeline struct {
// Deprecated [v0.101.0]
*zap.SugaredLogger
Graph *simple.DirectedGraph
startOnce sync.Once
stopOnce sync.Once
Expand Down
10 changes: 0 additions & 10 deletions pkg/stanza/testutil/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,10 @@ import (
"context"
"strings"
"sync"
"testing"

"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"go.uber.org/zap/zaptest"

"github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator"
)

// Deprecated [v0.101.0] Use zaptest.NewLogger directly instead
func Logger(t testing.TB) *zap.SugaredLogger {
return zaptest.NewLogger(t, zaptest.Level(zapcore.ErrorLevel)).Sugar()
}

type mockPersister struct {
data map[string][]byte
dataMux sync.Mutex
Expand Down

0 comments on commit 5c765a3

Please sign in to comment.