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

Feature request: Clear logs? #1885

Closed
ozburo opened this issue Jul 20, 2019 · 12 comments · Fixed by #4170
Closed

Feature request: Clear logs? #1885

ozburo opened this issue Jul 20, 2019 · 12 comments · Fixed by #4170
Labels
enhancement New feature or request

Comments

@ozburo
Copy link

ozburo commented Jul 20, 2019

Can we have a way to clear logs? I'm looking and can't find a way :)

I've been using the WebUI and would love a way to clear logs there; perhaps adding a "Clear logs" button at the top would do the trick? Or maybe also add a keyboard-command "Ctrl-K" to clear like we do in the Terminal?

For example

I tried reverting back to using the Tilt Terminal View to view/clear the logs, but no luck... Ctrl-K/L kills in the AsciiUI!

Cheers

@ozburo
Copy link
Author

ozburo commented Jul 20, 2019

You know what, I can still use kubectl logs -f <POD_ID> can't I 😊

@nicks
Copy link
Member

nicks commented Jul 22, 2019

Thanks for the suggestion! Ya, we've talked about this but gone back and forth on the right behavior...like should all the logs be cleared, or just logs for the resource you're looking at, or logs from dead pods, or something else? I like how browser devtools give you a lot of filter controls here.

It sounds like what you're looking for is "just look at the logs for one pod right now", right?

@jazzdan jazzdan added the enhancement New feature or request label Jul 22, 2019
@ozburo
Copy link
Author

ozburo commented Jul 23, 2019

or just logs for the resource you're looking at

Pretty much this. Just want to clear the logs for the specific Pod's log-view I'm on.

I like how browser devtools give you a lot of filter controls here

I was just thinking something very simple/basic -- clear the view of logs! No filtering etc. needed.

This could just be a frontend addition that simply removes the <code/> dom elements from the current view once the "Clear" button has been pressed; as simple as that :)

I addition (if we are feeling inspired) we could borrow the "Cmd-K" command from Terminal and have that clear logs as well.

More-so! We could also add "Cmd-L" to just clear the last N logs in view -- this way not everything is cleared -- you need to keep pressing to clearout your logs. Essentially, every time "Cmd-L" is pressed, one <code> node is removed...

That's it really, nothing more advanced than that -- I could even give this a shot in a new PR if you think that would be productive.

Cheers

@nicks
Copy link
Member

nicks commented Jul 24, 2019

@ozburo - I like the idea of making it client-only and seeing how it feels.

It would be a little bit more complicated then just removing the dom elements, because everything refreshes from a central data model. A good way to do it might be to keep a data model field like "HideLogsBeforeIndex: " for each ResourceView, and skip rendering of elements before that index.

If you're willing to take a shot at it, we would really appreciate it! Happy to provide any advice / assistance

@chuckha
Copy link

chuckha commented Aug 15, 2019

+1! This would be a useful feature for me. The reason is that I have three coordinated controllers across 3 different pods. I'd like to clear all my logs before I create an object then I can watch how each controller responds to that one event. It's a little tough to parse the logging output with all the "old" logs still around

@ozburo
Copy link
Author

ozburo commented Aug 18, 2019

@chuckha Glad I'm not the only one who wants this 👍

Sorry, I haven't been able to tackle this. I thought I would have extra time over the summer but alas no. I have taken a peek at the code and see ya'll are using TypeScript not vanilla JS so I'll need to get proficient at that before I could begin to contribute -- this could be the impetus to do so -- however it won't be soon.

@hyu hyu added this to Needs Triage in Tilt Roadmap Jan 25, 2020
@hyu hyu moved this from Needs Triage to Prioritized in Tilt Roadmap Jan 25, 2020
@adamchalmers
Copy link

Hey! Just chiming in to say
A. I love Tilt
B. I would really love that feature.

Here's my workflow: I use Tilt to reproduce a bug, then make a code change to fix it. Tilt rebuilds the container, keeping the same pod. Now I have both the logs from before/after my code change in the same window. This makes it hard to use the web UI to ctrl+f, because I'll get results from both runs.

It'd be great if there was a Wipe Logs button, kinda like how Chrome DevTools has the trashcan icon to wipe all network requests/console logs. It just helps me focus on only the relevant part of my logs.

@rhyek
Copy link

rhyek commented Mar 27, 2020

Please implement this feature. I am doing a lot of testing of graceful shutdowns for some services who tend to be rather verbose with their output and not being able to clear the logs makes it hard to pinpoint issues.

@daiyi
Copy link

daiyi commented Nov 13, 2020

+1 on this. I find the tilt log display difficult to visually parse. I usually clear my terminal before debugging something specific to easily see if new log lines appear, or make a few newline breaks, but I can't clear or mark in the tilt UI "this is the last thing I read" so it's difficult to have a feelings for when changes come in, which feels disruptive to my workflow.

@petzo
Copy link

petzo commented Jan 7, 2021

+1 for clear logs :)

@djcp
Copy link

djcp commented Jan 21, 2021

+1 here too!

@milas milas moved this from Prioritized to In Progress in Tilt Roadmap Feb 5, 2021
Tilt Roadmap automation moved this from In Progress to Done Feb 10, 2021
@milas
Copy link
Contributor

milas commented Feb 15, 2021

Clear logs functionality is available as of Tilt v0.18.9!

There's a handy clear logs button just above the logs themselves, as well as a keyboard shortcut: Ctrl + Backspace (on Windows/Linux) or Cmd + Backspace (on macOS).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Tilt Roadmap
  
Done
Development

Successfully merging a pull request may close this issue.

10 participants