Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Log file shouldn't be created or written to by default #1135

Closed
cole-h opened this issue Nov 20, 2021 · 6 comments
Closed

Log file shouldn't be created or written to by default #1135

cole-h opened this issue Nov 20, 2021 · 6 comments
Labels
A-helix-term Area: Helix term improvements C-discussion Category: Discussion or questions that doesn't represent real issues

Comments

@cole-h
Copy link
Contributor

cole-h commented Nov 20, 2021

Describe your feature request

The log file should be truncated, and should only be written to when using one of the verbosity flags. I can see, some day in the (distant?) future, where some user writes a post about how their helix log file was taking up gigabytes of disk space because it's append-only and never cleaned up.

The verbosity flag should take a filename argument that will then be created (if it doesn't exist) or truncated (if it does) and begin writing its logging information to it.

@cole-h cole-h added the C-enhancement Category: Improvements label Nov 20, 2021
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Nov 20, 2021
@archseer
Copy link
Member

Well, we went full circle on this. There was a bug that made us log continually every second when the LSP crashed. Which lead us to truncate the file each time. But then trying to open the logfile (or opening multiple helix instances) would wipe the file before you could read it.

@cole-h
Copy link
Contributor Author

cole-h commented Nov 21, 2021

Which is why IMO it should write to stderr by default, or the specified file, and only when run with -v.

@archseer
Copy link
Member

Logging only critical errors is helpful in the case of a crash though. Especially when we get bug reports from stripped builds that don't have a proper backtrace.

@cole-h
Copy link
Contributor Author

cole-h commented Nov 21, 2021

In that case, I think a good first step would be to write to stderr by default (and continue logging even without -v). If the user wants to put it in a file, it's easy to redirect stderr.

@kirawi
Copy link
Member

kirawi commented Nov 21, 2021

Maybe we could warn the user in Helix if their log is huge. Or maybe that's just lazy, idk.

@kirawi kirawi added C-discussion Category: Discussion or questions that doesn't represent real issues and removed C-enhancement Category: Improvements labels Nov 21, 2021
@alevinval
Copy link
Contributor

I looked into logging to stderr by default. If we do it, it's going to mess up the editor for most people, as it would force you to always redirect it, to avoid rendering issues as seen in [1].

However, as part of reviewing this ticket, I've opened a fix for the open-log command

[1] issue with logging by default to stderr Screenshot 2023-07-08 at 16 50 00

@helix-editor helix-editor locked and limited conversation to collaborators Apr 4, 2024
@pascalkuthe pascalkuthe converted this issue into discussion #10151 Apr 4, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
A-helix-term Area: Helix term improvements C-discussion Category: Discussion or questions that doesn't represent real issues
Projects
None yet
Development

No branches or pull requests

4 participants