logger: add missing slog shortcut aliases
This commit is contained in:
parent
682d70ed30
commit
bc82c8b59c
|
@ -24,6 +24,7 @@ const (
|
|||
var defaultLogger slog.Logger // nolint: gochecknoglobals
|
||||
|
||||
type Field = slog.Field
|
||||
type Map = slog.Map
|
||||
|
||||
func init() { // nolint: gochecknoinits
|
||||
defaultLogger = Make(FormatHuman, os.Stdout)
|
||||
|
@ -78,8 +79,12 @@ func F(name string, value interface{}) Field {
|
|||
return slog.F(name, value)
|
||||
}
|
||||
|
||||
func SetFormat(f Format) {
|
||||
defaultLogger = Make(f, os.Stdout)
|
||||
func M(fields ...Field) Map {
|
||||
return slog.M(fields...)
|
||||
}
|
||||
|
||||
func E(err error) Field {
|
||||
return slog.Error(err)
|
||||
}
|
||||
|
||||
func SetLevel(level slog.Level) {
|
||||
|
|
Loading…
Reference in New Issue