Skip to content

Commit

Permalink
docs: add missing slog option
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Nov 25, 2024
1 parent 1e493f8 commit 26969f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ A linter checks the odd number of key and value pairs for common logger librarie
- [kitlog](https://github.com/go-kit/log)
- [klog](https://github.com/kubernetes/klog)
- [logr](https://github.com/go-logr/logr)
- [zap](https://github.com/uber-go/zap)
- [log/slog](https://pkg.go.dev/log/slog)
- [zap](https://github.com/uber-go/zap)

It's recommended to use loggercheck with [golangci-lint](https://golangci-lint.run/usage/linters/#loggercheck).

Expand All @@ -27,7 +27,7 @@ go install github.com/timonwong/loggercheck/cmd/loggercheck
## Usage

```
loggercheck: Checks key value pairs for common logger libraries (kitlog,logr,klog,zap).
loggercheck: Checks key value pairs for common logger libraries (kitlog,klog,logr,slog,zap).
Usage: loggercheck [-flag] [package]
Expand All @@ -43,7 +43,7 @@ Flags:
-debug string
debug flags, any subset of "fpstv"
-disable value
comma-separated list of disabled logger checker (kitlog,klog,logr,zap) (default kitlog)
comma-separated list of disabled logger checker (kitlog,klog,logr,slog,zap) (default kitlog)
-fix
apply all suggested fixes
-flags
Expand Down
4 changes: 2 additions & 2 deletions loggercheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/timonwong/loggercheck/internal/sets"
)

const Doc = `Checks key value pairs for common logger libraries (kitlog,klog,logr,zap).`
const Doc = `Checks key value pairs for common logger libraries (kitlog,klog,logr,slog,zap).`

func NewAnalyzer(opts ...Option) *analysis.Analyzer {
l := newLoggerCheck(opts...)
Expand Down Expand Up @@ -54,7 +54,7 @@ func newLoggerCheck(opts ...Option) *loggercheck {
}

fs.StringVar(&l.ruleFile, "rulefile", "", "path to a file contains a list of rules")
fs.Var(&l.disable, "disable", "comma-separated list of disabled logger checker (kitlog,klog,logr,zap,slog)")
fs.Var(&l.disable, "disable", "comma-separated list of disabled logger checker (kitlog,klog,logr,slog,zap)")
fs.BoolVar(&l.requireStringKey, "requirestringkey", false, "require all logging keys to be inlined constant strings")
fs.BoolVar(&l.noPrintfLike, "noprintflike", false, "require printf-like format specifier not present in args")

Expand Down

0 comments on commit 26969f9

Please sign in to comment.