feat: scaffold go vehicle gateway core

This commit is contained in:
lingniu
2026-07-01 21:43:16 +08:00
parent d148a4e3af
commit 1fdbc29e27
12 changed files with 1107 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
package observability
import (
"log/slog"
"os"
)
// NewLogger returns a JSON logger with a stable service field so ECS logs from
// different Go processes can be filtered without relying on container names.
func NewLogger(service string) *slog.Logger {
handler := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{AddSource: true})
return slog.New(handler).With("service", service)
}