mirror of
https://github.com/regclient/regclient.git
synced 2025-04-17 11:37:11 +03:00
21 lines
439 B
Go
21 lines
439 B
Go
//go:build !wasm
|
|
// +build !wasm
|
|
|
|
package regclient
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
"github.com/regclient/regclient/internal/sloghandle"
|
|
)
|
|
|
|
// WithLog configuring logging with a logrus Logger.
|
|
// Note that regclient has switched to log/slog for logging and my eventually deprecate logrus support.
|
|
func WithLog(log *logrus.Logger) Opt {
|
|
return func(rc *RegClient) {
|
|
rc.slog = slog.New(sloghandle.Logrus(log))
|
|
}
|
|
}
|