Skip to content

Logging Middleware - TagLatency doesn't have standard format between modes#1943

Merged
ReneWerner87 merged 1 commit into
gofiber:masterfrom
marcelogamba:bugfix/LoggingTagLatency
Jul 4, 2022
Merged

Logging Middleware - TagLatency doesn't have standard format between modes#1943
ReneWerner87 merged 1 commit into
gofiber:masterfrom
marcelogamba:bugfix/LoggingTagLatency

Conversation

@marcelogamba

Copy link
Copy Markdown
Contributor

Please provide enough information so that others can review your pull request:

This change affects TagLatency in middleware logging.
Currently if you don't change the default format the latency output is using millisecond as rounding, however if you configure a custom logging message format it outputs using time.Duration (string) serialization.

I can enumerate two problems:

  • Standard between the two options (Default and Custom Format)
  • time.Duration will output characters in UTF8 and UNICODE (UTF-16) according to its serialization unit (microseconds)

This PR suggests replacing time.Duration serialization to millisecond, the same used in DefaultFormat.

@welcome

welcome Bot commented Jun 27, 2022

Copy link
Copy Markdown

Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@marcelogamba

Copy link
Copy Markdown
Contributor Author

Hi there, apparently there is a problem with other modules compiling/testing on MacOs.
Unfortunately I don't have a Mac to try a fix. As far as I noticed my change doesn't affected those tests failing (memory test).

Could anyone help?

@efectn

efectn commented Jun 28, 2022

Copy link
Copy Markdown
Member

Hi there, apparently there is a problem with other modules compiling/testing on MacOs. Unfortunately I don't have a Mac to try a fix. As far as I noticed my change doesn't affected those tests failing (memory test).

Could anyone help?

I don't think the problem is related this PR. Tests related timeout is falling randomly. I'll check them.

@ReneWerner87 ReneWerner87 merged commit e58ad6b into gofiber:master Jul 4, 2022
@welcome

welcome Bot commented Jul 4, 2022

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

trim21 pushed a commit to trim21/fiber that referenced this pull request Aug 15, 2022
… format (gofiber#1943)

Co-authored-by: Marcelo Gamba <gamba@itstransdata.com>
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.

3 participants