-
Notifications
You must be signed in to change notification settings - Fork 208
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
Control logging via command line or environment variable #1163
Conversation
Looks like lint flagged a few formatting issues. I can easily reorder the #include lines, but the rest doesn't make sense to me. Why does it want to indent with 2 spaces when the existing code is clearly using 4 spaces? Was lint misconfigured? Why does it want to insert more than 30 spaces of indentation in the last flagged section of main.cpp? That wastes a lot of space and doesn't align with anything. |
What version of lint is being used here? What configuration? |
we use clang format for linting and our configuration is in the root of the repository under |
Ah, there it is.
That's what I mean by inconsistent. (Maybe I should have said "internally inconsistent".) If that's the format you prefer, though, that's what I'll use. :) Thanks for the info. I'll reformat and resubmit. |
Can you update the manpage as well? I think that just mentions the debug switch atm. |
|
f711fe5
to
5cf830e
Compare
Changes since last draft:
I went with --log because easy typing is important to me. Thanks for allowing it. However: What about satisfying the desire for a common prefix while still allowing easy typing, by adding short forms of these options? For example:
(I'm a little embarrassed for not suggesting this earlier. In new projects, I usually reserve short command line options until I know what the most common operations will be, since there are only so many letters available. Since Nheko is already in real-world use and its common operations are all through the GUI, it's a non-issue here.) |
a1d666b
to
4534333
Compare
|
I think this looks pretty nice now, I would just prefer it if the different log level flags were not merged, but instead would overwrite each other. Otherwise it can be hard to troubleshoot, why something behaves weirdly, imo. |
Nheko is very chatty in its log output, generating log noise (which complicates diagnostics) and needless disk writes (which affect power consumption and SSD life). This patch introduces command line options and environment variables to control log levels and output type. The old --debug command line option still works, at least for now. It is overridden by the new command line options when they are used. Partially addresses Nheko-Reborn#665.
4534333
to
80f7683
Compare
Awesome, thank you for your patience! |
Nheko is very chatty in its log output, generating log noise (which complicates diagnostics) and needless disk writes (which affect power consumption and SSD life). This patch provides control over it, with command line options for:
The old --debug command line option still works, at least for now, and is overridden by the new fine-grained option.
Log levels and output type (file/stderr) can also be set by environment variables. (This is especially convenient for flatpak users, who can
flatpak override --env=
instead of having to copy and edit the .desktop file to add command line options.)Partially addresses #665.