chore: establish chub go foundation
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log/slog"
|
||||
)
|
||||
|
||||
// New creates the process logger. Callers provide the sink so tests and the
|
||||
// command entry point do not need to share global logging state.
|
||||
func New(w io.Writer) *slog.Logger {
|
||||
if w == nil {
|
||||
w = io.Discard
|
||||
}
|
||||
return slog.New(slog.NewJSONHandler(w, &slog.HandlerOptions{Level: slog.LevelInfo}))
|
||||
}
|
||||
Reference in New Issue
Block a user