1
0
mirror of https://github.com/regclient/regclient.git synced 2025-04-17 11:37:11 +03:00
regclient/regclient_nowasm.go
Brandon Mitchell 289533b02c
Feat: Move logrus calls into files excluded by wasm
This permits builds of wasm binaries.

Signed-off-by: Brandon Mitchell <git@bmitch.net>
2024-11-12 10:18:47 -05:00

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))
}
}