Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jun 21, 2023

Description

#2493 introduces DisableColors, but it's default value is set to true, which contradicts the documentation:

https://docs.gofiber.io/api/middleware/logger#config

// DisableColors defines if the logs output should be colorized
//
// Default: false
DisableColors bool

https://docs.gofiber.io/api/middleware/logger#default-config, as well as https://github.com/gofiber/fiber/blob/master/middleware/logger/config.go#L94

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,
    	DisableColors: true,
}

and therefore, coloring is disabled by default, and can only be enabled by explicitly setting DisableColors to false

app.Use(logger.New(logger.Config{DisableColors: false}))

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation - /docs/ directory for https://docs.gofiber.io/
  • New and existing unit tests pass locally with my changes

Commit formatting:

Use emojis on commit messages so it provides an easy way of identifying the purpose or intention of a commit. Check out the emoji cheatsheet here: https://gitmoji.carloscuesta.me/

@ReneWerner87
Copy link
Member

@cmd777 can you look at the tests
image

Basically add ˙enableColors: true˙ back to default config
@ghost
Copy link
Author

ghost commented Jun 22, 2023

@ReneWerner87 okay, the logger tests were fixed
Screenshot from 2023-06-22 11-34-10

just another test file failed with Test_Ctx_SendFile_RestoreOriginalURL
Screenshot from 2023-06-22 11-36-00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant