mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-07-07 00:44:04 +00:00
Update dependencies and build to go1.22 (#2113)
* Update dependencies and build to go1.22 * Fix api changes wrt to dependencies * Update golangci config
This commit is contained in:
27
vendor/github.com/labstack/echo/v4/middleware/request_logger.go
generated
vendored
27
vendor/github.com/labstack/echo/v4/middleware/request_logger.go
generated
vendored
@ -1,3 +1,6 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// SPDX-FileCopyrightText: © 2015 LabStack LLC and Echo contributors
|
||||
|
||||
package middleware
|
||||
|
||||
import (
|
||||
@ -8,6 +11,30 @@ import (
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
// Example for `slog` https://pkg.go.dev/log/slog
|
||||
// logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
|
||||
// e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
|
||||
// LogStatus: true,
|
||||
// LogURI: true,
|
||||
// LogError: true,
|
||||
// HandleError: true, // forwards error to the global error handler, so it can decide appropriate status code
|
||||
// LogValuesFunc: func(c echo.Context, v middleware.RequestLoggerValues) error {
|
||||
// if v.Error == nil {
|
||||
// logger.LogAttrs(context.Background(), slog.LevelInfo, "REQUEST",
|
||||
// slog.String("uri", v.URI),
|
||||
// slog.Int("status", v.Status),
|
||||
// )
|
||||
// } else {
|
||||
// logger.LogAttrs(context.Background(), slog.LevelError, "REQUEST_ERROR",
|
||||
// slog.String("uri", v.URI),
|
||||
// slog.Int("status", v.Status),
|
||||
// slog.String("err", v.Error.Error()),
|
||||
// )
|
||||
// }
|
||||
// return nil
|
||||
// },
|
||||
// }))
|
||||
//
|
||||
// Example for `fmt.Printf`
|
||||
// e.Use(middleware.RequestLoggerWithConfig(middleware.RequestLoggerConfig{
|
||||
// LogStatus: true,
|
||||
|
Reference in New Issue
Block a user