Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling breaks when request takes long #1823

Closed
mjarkk opened this issue Mar 22, 2019 · 4 comments · Fixed by #1830 or ez-max/gin#1
Closed

Styling breaks when request takes long #1823

mjarkk opened this issue Mar 22, 2019 · 4 comments · Fixed by #1830 or ez-max/gin#1

Comments

@mjarkk
Copy link

mjarkk commented Mar 22, 2019

  • go version: go version go1.10.4 linux/amd64
  • gin version (or commit ref): 5acf6601170bb49a1958c055d66d54ba152dc34b
  • operating system: elementary OS 5.0 Juno

Description

If a request takes long like web sockets the logging gets a bit messed up
see the screenshot
This request takes long because it's a web-socket

Screenshots

Screenshot from 2019-03-22 11-55-43

@dmarkham
Copy link
Contributor

@thinkerou what are you thoughts about just reducing the resolution of the duration when it gets above a defined threshold? Lets say 1m. Once any request duration goes above 1m it's precision in the default logger truncates to seconds.

@thinkerou
Copy link
Member

@dmarkham this is a good thinking, maybe I also set max width for websocket request, please see #1825 do you think? thanks!

dmarkham added a commit to dmarkham/gin that referenced this issue Mar 26, 2019
@dmarkham
Copy link
Contributor

For this issue at least this is what I was thinking.

dmarkham added a commit to dmarkham/gin that referenced this issue Mar 26, 2019
@dmarkham
Copy link
Contributor

Of course duration.Truncate() was not added until 1.9 so that makes my patch less interesting :( But that is 4 versions ago. Go only supports 2 versions back, hint hint. Maybe we can get within 4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants