mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-04-09 10:41:55 -04:00
auth+transcoder: update msg format for easier use (#1262)
Co-authored-by: Zoe Roux <zoe.roux@zoriya.dev>
This commit is contained in:
parent
9163dccef7
commit
52f4b15fbf
@ -280,7 +280,8 @@ func main() {
|
||||
LogValuesFunc: func(c echo.Context, v middleware.RequestLoggerValues) error {
|
||||
rCtx := c.Request().Context()
|
||||
if v.Error == nil {
|
||||
logger.LogAttrs(rCtx, slog.LevelInfo, "web_request",
|
||||
logger.LogAttrs(rCtx, slog.LevelInfo,
|
||||
fmt.Sprintf("%s %s%s %d", v.Method, v.Host, v.URI, v.Status),
|
||||
slog.String("method", v.Method),
|
||||
slog.Int("status", v.Status),
|
||||
slog.String("host", v.Host),
|
||||
@ -288,7 +289,9 @@ func main() {
|
||||
slog.String("agent", v.UserAgent),
|
||||
)
|
||||
} else {
|
||||
logger.LogAttrs(rCtx, slog.LevelError, "web_request_error",
|
||||
logger.LogAttrs(rCtx, slog.LevelError,
|
||||
fmt.Sprintf("%s %s%s %d err=%s",
|
||||
v.Method, v.Host, v.URI, v.Status, v.Error.Error()),
|
||||
slog.String("method", v.Method),
|
||||
slog.Int("status", v.Status),
|
||||
slog.String("host", v.Host),
|
||||
|
||||
@ -140,7 +140,8 @@ func main() {
|
||||
LogValuesFunc: func(c echo.Context, v middleware.RequestLoggerValues) error {
|
||||
rCtx := c.Request().Context()
|
||||
if v.Error == nil {
|
||||
logger.LogAttrs(rCtx, slog.LevelInfo, "web_request",
|
||||
logger.LogAttrs(rCtx, slog.LevelInfo,
|
||||
fmt.Sprintf("%s %s%s %d", v.Method, v.Host, v.URI, v.Status),
|
||||
slog.String("method", v.Method),
|
||||
slog.Int("status", v.Status),
|
||||
slog.String("host", v.Host),
|
||||
@ -148,7 +149,9 @@ func main() {
|
||||
slog.String("agent", v.UserAgent),
|
||||
)
|
||||
} else {
|
||||
logger.LogAttrs(rCtx, slog.LevelError, "web_request_error",
|
||||
logger.LogAttrs(rCtx, slog.LevelError,
|
||||
fmt.Sprintf("%s %s%s %d err=%s",
|
||||
v.Method, v.Host, v.URI, v.Status, v.Error.Error()),
|
||||
slog.String("method", v.Method),
|
||||
slog.Int("status", v.Status),
|
||||
slog.String("host", v.Host),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user