Skip to content

Commit

Permalink
chore: Forbids "log" package only for aggregators, inputs, outputs, p…
Browse files Browse the repository at this point in the history
…arsers and processors (#10191)

Co-authored-by: Pawel Zak <Pawel Zak>
(cherry picked from commit 1143a50)
  • Loading branch information
zak-pawel authored and MyaLongmire committed Dec 8, 2021
1 parent 8d65717 commit 47fa0fa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,10 @@ issues:
- path: _test\.go
text: "parameter.*seems to be a control flag, avoid control coupling"

- path: (^agent/|^cmd/|^config/|^filter/|^internal/|^logger/|^metric/|^models/|^selfstat/|^testutil/|^plugins/serializers/)
text: "imports-blacklist: should not use the following blacklisted import: \"log\""
linters:
- revive

output:
format: tab
2 changes: 1 addition & 1 deletion plugins/common/logrus/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package logrus

import (
"io"
"log"
"log" //nolint:revive // Allow exceptional but valid use of log here.
"strings"
"sync"

Expand Down
2 changes: 1 addition & 1 deletion plugins/common/shim/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package shim
import (
"errors"
"fmt"
"log"
"log" //nolint:revive // Allow exceptional but valid use of log here.
"os"

"github.com/BurntSushi/toml"
Expand Down
2 changes: 1 addition & 1 deletion plugins/common/shim/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package shim

import (
"fmt"
"log"
"log" //nolint:revive // Allow exceptional but valid use of log here.
"os"
"reflect"

Expand Down

0 comments on commit 47fa0fa

Please sign in to comment.