mirror of
https://github.com/versity/versitygw.git
synced 2026-09-19 14:34:19 +00:00
Added missing debug logs in the `front-end` and `utility` functions. Enhanced debug logging with the following improvements: - Each debug message is now prefixed with [DEBUG] and appears in color. - The full request URL is printed at the beginning of each debug log block. - Request/response details are wrapped in framed sections for better readability. - Headers are displayed in a colored box. - XML request/response bodies are pretty-printed with indentation and color.
30 lines
916 B
Go
30 lines
916 B
Go
// Copyright 2023 Versity Software
|
|
// This file is licensed under the Apache License, Version 2.0
|
|
// (the "License"); you may not use this file except in compliance
|
|
// with the License. You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing,
|
|
// software distributed under the License is distributed on an
|
|
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
// KIND, either express or implied. See the License for the
|
|
// specific language governing permissions and limitations
|
|
// under the License.
|
|
|
|
package middlewares
|
|
|
|
import (
|
|
"github.com/gofiber/fiber/v2"
|
|
"github.com/versity/versitygw/s3api/debuglogger"
|
|
)
|
|
|
|
func DebugLogger() fiber.Handler {
|
|
return func(ctx *fiber.Ctx) error {
|
|
debuglogger.LogFiberRequestDetails(ctx)
|
|
err := ctx.Next()
|
|
debuglogger.LogFiberResponseDetails(ctx)
|
|
return err
|
|
}
|
|
}
|