-
Notifications
You must be signed in to change notification settings - Fork 697
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
Change default log level to warning. #5885
Conversation
Cross-referencing the original discussion: #5723. |
Also I disagree that the default should be error. We should preserve current behavior and allow users who are bothered by it to adjust Ghostty in accordance to their wishes. |
I suppose I could leave the default level at info and just keep |
The main issue with having opt-in as opposed to opt-out logging is that people will paste the logs without |
b8bf40c
to
13330f2
Compare
-q/--quiet
and -v/--verbose
logging options.-v/--verbose
logging option.
13330f2
to
d93dce8
Compare
I'm going to leave it at error. The point of the PR was to make the default logging behavior like that of most other terminal emulators. I.E. quiet. If the direction is to leave the default at info then the PR can just be closed. |
I'm not fully sure about this change yet (PR without an issue so its at your own risk anyways). But, I will say the default should be "warn." The "error" log level in Zig is meant to indicate a fatal, non-recoverable error where the program either exits immediately or is likely in a severely broken state. A warning is meant to indicate an unexpected, possibly problematic (but maybe not) issue. If we have spurious "warn" logs we should quiet those rather than raise the default to error. |
Another thought that I want to make sure I get down, I've thought it a few times but keep forgetting to put it down so here seems to be best: I think its generally helpful to have verbose logs when starting from a desktop location, because if something goes wrong, its easier to have ready access to some log course (i.e. Console.app on macOS, syslog-style locations on Linux). So we may want to consider only defaulting to quiet if we're not launched from the desktop (we have an API for this already |
Heh, that's on @pluiedev. She recommended I open the PR. :)
Makes sense.
Agreed.
AFAIK stdout and stderr go nowhere in Linux when started from a .desktop file. Well, unless it's a Gnome thing. Was that the reason for the macos-specific logging in logFn()?
Can do. So to recap: Default is warn unless started from the desktop in which case it's info. |
I've never checked my own system log (edit: just checked, the launcher I use doesn't redirect it) but some launchers seem to redirect it to the system log as this user found: #3614 (reply in thread). |
Yep! macOS has a builtin GUI app (Console.app) and CLI (
Yeah I think this all makes sense, or at least I would take a look at that. I'm also suggesting we remove |
Depending on the system, that all probably goes to the systemd user journal. Well, assuming you are using systemd. Use |
Yeah, I already checked journalctl --user. Nothing. |
Ghostty's default log level is now "warning" unless one of the following conditions is met... * A "+action" is being run in which case it's "error". * There's no app_runtime (lib mode) in which case it's "error". * The GHOSTTY_LOG environment variable isn't empty in which case it's "info". * Ghostty was started from a desktop/launcher icon in which case it's "info". * A debug build is being run in which case it's "debug". The conditons are evaluated from top to bottom and the last one met wins.
d93dce8
to
5546fd7
Compare
-v/--verbose
logging option.
PR updated. See the PR description for new status. @mitchellh Can I submit a new PR now to squash the warnings (or convert to info)? It doesn't depend on this PR. |
What about instead of changing the logging level of some of these, we condition the log on the release level (i.e. they would be suppressed in anything but Debug level)? |
I'm not following. Wouldn't that be the same as changing just their message levels to debug? |
The main difference is that warnings are emitted during a |
That didn't really clarify anything. :) It's late though and my brain is fried so let me read that again in the morning. |
@jcollie Sleep didn't help. Can you give me a code snippet to demonstrate the result you're proposing? |
Ghostty's default log level is now "warning" unless one of the following
conditions is met...
The conditons are evaluated from top to bottom and the last one met wins.