Skip to content
/ slogx Public

Golang extensions for log/slog

License

MIT, BSD-3-Clause licenses found

Licenses found

MIT
LICENSE
BSD-3-Clause
LICENSE-go
Notifications You must be signed in to change notification settings

powerman/slogx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang extensions for log/slog

Go Reference CI/CD Coverage Status Go Report Card Release

Recommendations

Using CtxHandler with linter

Disable non-Context slog functions (e.g. slog.Info) and methods using linter.

Example in golangci-lint config:

linters-settings:
  ...
  forbidigo:
    ...
    forbid:
      # slogx.CtxHandler support:
      - p: ^slog\.(Logger\.)?Error$
        msg: Use ErrorContext to support slogx.CtxHandler
      - p: ^slog\.(Logger\.)?Warn$
        msg: Use WarnContext to support slogx.CtxHandler
      - p: ^slog\.(Logger\.)?Info$
        msg: Use InfoContext to support slogx.CtxHandler
      - p: ^slog\.(Logger\.)?Debug$
        msg: Use DebugContext to support slogx.CtxHandler
    analyze-types: true

About

Golang extensions for log/slog

Resources

License

MIT, BSD-3-Clause licenses found

Licenses found

MIT
LICENSE
BSD-3-Clause
LICENSE-go

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages