Open
Description
Given configuration like this:
logger := logr.FromSlogHandler(slog.Default().Handler())
provider = flagd.NewProvider(
flagd.WithLogger(logger),
flagd.WithInProcessResolver(),
flagd.WithOfflineFilePath(path),
)
I would expect the provided logger
instance to be used but I actually see log output implying that it is not and when I dug into the provider initialization I see that the configured logger is ignored and that a new instance is created:
go-sdk-contrib/providers/flagd/pkg/service/in_process/service.go
Lines 40 to 62 in b90eb4d
This is tricky in my app because we don't use JSON as our log format so we end up with weird looking logs like this:
time=2024-06-06T10:02:58.161598000+01:00 level=INFO msg="Starting up server"
time=2024-06-06T10:02:58.258284000+01:00 level=INFO msg="Tracing is enabled" endpoint=localhost:4318 service=core-api
{"level":"info","ts":"2024-06-06T10:02:58+01:00","msg":"operating in in-process mode with offline flags sourced from /<redacted>/cmd/api/features.json"}
{"level":"info","ts":"2024-06-06T10:02:58+01:00","msg":"Starting filepath sync notifier"}
{"level":"info","ts":"2024-06-06T10:02:58+01:00","msg":"watching filepath: /Users/andy/poolside/forge/cmd/api/features.json"}
time=2024-06-06T10:02:58.276403000+01:00 level=INFO msg="Database is ready to serve"