Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Forbids "log" package only for aggregators, inputs, outputs, parsers and processors #10191

Merged
merged 4 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
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

powersj marked this conversation as resolved.
Show resolved Hide resolved
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