feat: initial Beta 1 release
- soju raw connector with event playback and CHATHISTORY fallback - SQLite store with msgid de-dup and retention job - Mentions + Pushover + tuning; structured JSON logs - Summaries: concise, link-following, multi-line grouping - HTTP: /healthz, /ready, /tail, /trigger, /metrics - Docker: distroless, healthcheck, version metadata - Docs: README, CHANGELOG, compose
This commit is contained in:
commit
2954e85e7a
19 changed files with 1983 additions and 0 deletions
24
internal/logging/logging.go
Normal file
24
internal/logging/logging.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package logging
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// New returns a JSON slog logger configured to the provided level string (debug, info, warn, error).
|
||||
func New(level string) *slog.Logger {
|
||||
lvl := slog.LevelInfo
|
||||
switch strings.ToLower(strings.TrimSpace(level)) {
|
||||
case "debug":
|
||||
lvl = slog.LevelDebug
|
||||
case "info", "":
|
||||
lvl = slog.LevelInfo
|
||||
case "warn", "warning":
|
||||
lvl = slog.LevelWarn
|
||||
case "err", "error":
|
||||
lvl = slog.LevelError
|
||||
}
|
||||
h := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{Level: lvl})
|
||||
return slog.New(h)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue