feat(platform): add postgres, redis, logging and graceful http serving
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
9662a3cea2
commit
1a6fadb030
6 files changed
+231
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package platform
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
|
||||
"git.zb-server.de/ZB-Server/uptimesebi/internal/buildinfo"
|
||||
"git.zb-server.de/ZB-Server/uptimesebi/internal/config"
|
||||
)
|
||||
|
||||
func NewLogger(c config.Common, component string) *slog.Logger {
|
||||
opts := &slog.HandlerOptions{Level: c.LogLevel}
|
||||
var h slog.Handler
|
||||
if c.LogFormat == "text" {
|
||||
h = slog.NewTextHandler(os.Stderr, opts)
|
||||
} else {
|
||||
h = slog.NewJSONHandler(os.Stderr, opts)
|
||||
}
|
||||
return slog.New(h).With("component", component, "version", buildinfo.Version)
|
||||
}
|
||||
Reference in new issue
Block a user