mirror of
https://github.com/gofiber/fiber.git
synced 2025-02-23 06:04:23 +00:00
Set logger config default values
This commit is contained in:
parent
3a6ae283b1
commit
566db0ae96
@ -108,6 +108,19 @@ func Logger(format ...string) fiber.Handler {
|
||||
|
||||
// LoggerWithConfig allows you to pass an CompressConfig
|
||||
func LoggerWithConfig(config LoggerConfig) fiber.Handler {
|
||||
// Set config default values
|
||||
if config.Format == "" {
|
||||
config.Format = LoggerConfigDefault.Format
|
||||
}
|
||||
|
||||
if config.TimeFormat == "" {
|
||||
config.TimeFormat = LoggerConfigDefault.TimeFormat
|
||||
}
|
||||
|
||||
if config.Output == nil {
|
||||
config.Output = LoggerConfigDefault.Output
|
||||
}
|
||||
|
||||
// Middleware settings
|
||||
var mutex sync.RWMutex
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user