chore: add go config and logging layer
This commit is contained in:
1 parent
e4bfc62c18
commit
2112821f79
12 files changed
+265
-30
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"os"
|
||||
)
|
||||
|
||||
func New(service string, appEnv string, level slog.Level) *slog.Logger {
|
||||
handler := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{
|
||||
Level: level,
|
||||
})
|
||||
|
||||
return slog.New(handler).With(
|
||||
"service", service,
|
||||
"env", appEnv,
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user