coder / internal

Non-community issues related to coder/coder
2 stars 0 forks source link

Investigate preventing log spam from burying access URL on initial setup #54

Closed sreya closed 3 weeks ago

sreya commented 1 month ago

Right now when you start Coder for the first time your access url can get buried by the deluge of logs that we emit. It'd be nice if we kept the noise at bay somehow. It's my suspicion that we're using the Info level too liberally.

sreya commented 1 month ago

@ammario what if we automatically open the user's browser when they start up Coder for the first time?

ammario commented 4 weeks ago

That helps but the output should still be clean as many will start coder on a remote server

ethanndickson commented 4 weeks ago

Something I noticed today: If you have a fresh database the logs don't stream as quickly, and the link ends up sitting there for a good 4-5 seconds longer than normal.

Beyond that, I'm thinking we could check if the terminal is a TTY, and if it is, pausing the log output for a few seconds?

ammario commented 4 weeks ago

Under basically no circumstances should we intentionally delay logs. This will look like a performance bug to users and probably our future core devs. We should do two things:

  1. Greatly reduce the number of logs emitted at the default level
  2. Emphasize the URL with padding and coloring, e.g.
  .-------------------------------------.
 /        Access URL                    \
|  .---------------------------------.   |
|  | https://example.com/path        |   |
|  '---------------------------------'   |
 \______________________________________/
ethanndickson commented 3 weeks ago

We could use lipgloss for this, but I've got a Border style for coder/pretty working. Will try and make it faster than lipgloss, and see if I can get nested boxes to work.

pretty.Border(pretty.RoundedBorder, termenv.RGBColor("#00ff00"), 2, 2)
╭──────────────────────────╮
│                          │
│                          │
│       Access URL:        │
│   http://localhost:8080  │
│                          │
│                          │
╰──────────────────────────╯  
ammario commented 3 weeks ago

My box was pretty bad. I think zero vert padding and but a solid border of bars would be good.

I don't think you have to use pretty for this as it's not really something that would be composed often.