Skip to content

Commit

Permalink
another log fix
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed Feb 10, 2025
1 parent d8fd8f2 commit 66bf81b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kindling.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type httpDialer func(ctx context.Context, addr string) (http.RoundTripper, error
type kindling struct {
httpDialers []httpDialer
rootCA string
logWriter io.Writer
}

// Make sure that kindling implements the Kindling interface.
Expand All @@ -43,7 +44,10 @@ type Option func(*kindling)

// NewKindling returns a new Kindling.
func NewKindling(options ...Option) Kindling {
k := &kindling{}
k := &kindling{
logWriter: os.Stdout,
}

// Apply all the functional options to configure the client.
for _, opt := range options {
opt(k)
Expand Down Expand Up @@ -85,6 +89,7 @@ func WithRootCA(rootCA string) Option {
// This should be the first option to be applied to the Kindling to ensure that all logs are captured.
func WithLogWriter(w io.Writer) Option {
return func(k *kindling) {
k.logWriter = w
log = slog.New(slog.NewTextHandler(w, &slog.HandlerOptions{}))
}
}
Expand Down

0 comments on commit 66bf81b

Please sign in to comment.