Skip to content

Commit

Permalink
🩹 Fix: default logger color behaviour (#2513)
Browse files Browse the repository at this point in the history
* Fix logger colors

* Fix tests
Basically add ˙enableColors: true˙ back to default config
  • Loading branch information
cmd777 authored Jun 22, 2023
1 parent a312a17 commit 1b060cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/api/middleware/logger.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ var ConfigDefault = Config{
TimeZone: "Local",
TimeInterval: 500 * time.Millisecond,
Output: os.Stdout,
DisableColors: true,
DisableColors: false,
}
```

Expand Down
17 changes: 9 additions & 8 deletions middleware/logger/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ type LogFunc func(output Buffer, c *fiber.Ctx, data *Data, extraParam string) (i

// ConfigDefault is the default config
var ConfigDefault = Config{
Next: nil,
Done: nil,
Format: "[${time}] ${status} - ${latency} ${method} ${path}\n",
TimeFormat: "15:04:05",
TimeZone: "Local",
TimeInterval: 500 * time.Millisecond,
Output: os.Stdout,
enableColors: false,
Next: nil,
Done: nil,
Format: "[${time}] ${status} - ${latency} ${method} ${path}\n",
TimeFormat: "15:04:05",
TimeZone: "Local",
TimeInterval: 500 * time.Millisecond,
Output: os.Stdout,
DisableColors: false,
enableColors: true,
}

// Helper function to set default values
Expand Down

1 comment on commit 1b060cb

@ReneWerner87
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 1b060cb Previous: a312a17 Ratio
Benchmark_TrimLeft/fiber 11.39 ns/op 0 B/op 0 allocs/op 3.7 ns/op 0 B/op 0 allocs/op 3.08

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.