chore: establish chub go foundation

This commit is contained in:
QiuSW
2026-07-22 14:51:11 +08:00
commit f8aaaeda21
28 changed files with 886 additions and 0 deletions
+15
View File
@@ -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}))
}