mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
change default log level to WARNING
The default foot output looks like this, in Debian testing "bookworm"
at the time of writing:
anarcat@angela:pubpaste$ foot true
info: main.c:421: version: 1.13.1 +pgo +ime +graphemes -assertions
info: main.c:428: arch: Linux x86_64/64-bit
info: main.c:440: locale: fr_CA.UTF-8
info: config.c:3003: loading configuration from /home/anarcat/.config/foot/foot.ini
info: fcft.c:338: fcft: 3.1.5 +graphemes -runs +svg(nanosvg) -assertions
info: fcft.c:377: fontconfig: 2.13.1, freetype: 2.12.1, harfbuzz: 5.2.0
info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=8.00pt/8px, dpi=75.00
info: wayland.c:1353: eDP-1: 2256x1504+0x0@60Hz 0x095F 13.32" scale=2 PPI=205x214 (physical) PPI=136x143 (logical), DPI=271.31
info: wayland.c:1509: requesting SSD decorations
info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Bold.otf: size=24.00pt/32px, dpi=96.00
info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=24.00pt/32px, dpi=96.00
info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Bold.otf: size=24.00pt/32px, dpi=96.00
info: fcft.c:838: /home/anarcat/.local/share/fonts/Fira-4.202/otf/FiraMono-Regular.otf: size=24.00pt/32px, dpi=96.00
info: terminal.c:700: cell width=19, height=39
info: terminal.c:588: using 16 rendering threads
info: wayland.c:859: using SSD decorations
info: main.c:680: goodbye
anarcat@angela:pubpaste$
That's 17 lines of output that are *mostly* useless for most use
cases. I might understand having this output during the project's
startup, when it's helpful for diagnostics, but now Foot just mostly
works everywhere, and I've never had a use for any of that stuff in
the (arguably short) time I've been using Foot so far.
And if I do, there's the `--log-level` commandline option to tweak
this. At first, I looked at tweaking the log level through the config
file. But as explained in this issue:
https://codeberg.org/dnkl/foot/issues/1142
... there's a chicken and egg problem there that makes it hard to
implement and possibly confusing for users as well.
There's also the possibility for users to change the shortcut with
which they start foot, for example a `.desktop` file so that menu
systems that support those start foot properly. But that only works in
that environment, and not through the so many things that will just
call `foot` and hope it will do the right thing.
In my case, I have `foot` hardcoded in a lot of places now, between
sway and waybar, and this is only going to grow. Others have suggested
adding the flag to a $TERMINAL global variable, but that won't help
.desktop users.
So, instead of playing whack-a-mole with the log levels, just make it
so that, by default, foot is silent. This is actually one of the
[basics of UNIX philosophy][1]:
> Rule of Silence: When a program has nothing surprising to say, it
> should say nothing.
And yes, I am aware I am severely violating that principle by writing
a way too long commit log for a one-line patch, but there you go, I
figured it was good to document the why of this properly.
[1]: https://web.archive.org/web/20031102053334/http://www.faqs.org/docs/artu/ch01s06.html
This commit is contained in:
parent
4d2b8a993f
commit
b80c7f75fe
8 changed files with 11 additions and 9 deletions
|
|
@ -65,9 +65,11 @@
|
||||||
modes that are known but unsupported.
|
modes that are known but unsupported.
|
||||||
* Set `PWD` environment variable in the slave process ([#1179][1179]).
|
* Set `PWD` environment variable in the slave process ([#1179][1179]).
|
||||||
* DPI is now forced to 96 when found to be unreasonably high.
|
* DPI is now forced to 96 when found to be unreasonably high.
|
||||||
|
* Set default log level to warning ([#1215][1215]).
|
||||||
|
|
||||||
[1166]: https://codeberg.org/dnkl/foot/issues/1166
|
[1166]: https://codeberg.org/dnkl/foot/issues/1166
|
||||||
[1179]: https://codeberg.org/dnkl/foot/issues/1179
|
[1179]: https://codeberg.org/dnkl/foot/issues/1179
|
||||||
|
[1215]: https://codeberg.org/dnkl/foot/pulls/1215
|
||||||
|
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
||||||
4
client.c
4
client.c
|
|
@ -94,7 +94,7 @@ print_usage(const char *prog_name)
|
||||||
" -N,--no-wait detach the client process from the running terminal, exiting immediately\n"
|
" -N,--no-wait detach the client process from the running terminal, exiting immediately\n"
|
||||||
" -o,--override=[section.]key=value override configuration option\n"
|
" -o,--override=[section.]key=value override configuration option\n"
|
||||||
" -E, --client-environment exec shell using footclient's environment, instead of the server's\n"
|
" -E, --client-environment exec shell using footclient's environment, instead of the server's\n"
|
||||||
" -d,--log-level={info|warning|error|none} log level (info)\n"
|
" -d,--log-level={info|warning|error|none} log level (warning)\n"
|
||||||
" -l,--log-colorize=[{never|always|auto}] enable/disable colorization of log output on stderr\n"
|
" -l,--log-colorize=[{never|always|auto}] enable/disable colorization of log output on stderr\n"
|
||||||
" -v,--version show the version number and quit\n"
|
" -v,--version show the version number and quit\n"
|
||||||
" -e ignored (for compatibility with xterm -e)\n";
|
" -e ignored (for compatibility with xterm -e)\n";
|
||||||
|
|
@ -178,7 +178,7 @@ main(int argc, char *const *argv)
|
||||||
|
|
||||||
const char *custom_cwd = NULL;
|
const char *custom_cwd = NULL;
|
||||||
const char *server_socket_path = NULL;
|
const char *server_socket_path = NULL;
|
||||||
enum log_class log_level = LOG_CLASS_INFO;
|
enum log_class log_level = LOG_CLASS_WARNING;
|
||||||
enum log_colorize log_colorize = LOG_COLORIZE_AUTO;
|
enum log_colorize log_colorize = LOG_COLORIZE_AUTO;
|
||||||
bool hold = false;
|
bool hold = false;
|
||||||
bool client_environment = false;
|
bool client_environment = false;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ complete -c foot -x -s W -l window-size-chars
|
||||||
complete -c foot -F -s s -l server -d "run as server; open terminals by running footclient"
|
complete -c foot -F -s s -l server -d "run as server; open terminals by running footclient"
|
||||||
complete -c foot -s H -l hold -d "remain open after child process exits"
|
complete -c foot -s H -l hold -d "remain open after child process exits"
|
||||||
complete -c foot -r -s p -l print-pid -d "print PID to this file or FD when up and running (server mode only)"
|
complete -c foot -r -s p -l print-pid -d "print PID to this file or FD when up and running (server mode only)"
|
||||||
complete -c foot -x -s d -l log-level -a "info warning error none" -d "log-level (info)"
|
complete -c foot -x -s d -l log-level -a "info warning error none" -d "log-level (warning)"
|
||||||
complete -c foot -x -s l -l log-colorize -a "always never auto" -d "enable or disable colorization of log output on stderr"
|
complete -c foot -x -s l -l log-colorize -a "always never auto" -d "enable or disable colorization of log output on stderr"
|
||||||
complete -c foot -s S -l log-no-syslog -d "disable syslog logging (server mode only)"
|
complete -c foot -s S -l log-no-syslog -d "disable syslog logging (server mode only)"
|
||||||
complete -c foot -s v -l version -d "show the version number and quit"
|
complete -c foot -s v -l version -d "show the version number and quit"
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ _arguments \
|
||||||
'(-s --server)'{-s,--server}'[run as server; open terminals by running footclient]:server:_files' \
|
'(-s --server)'{-s,--server}'[run as server; open terminals by running footclient]:server:_files' \
|
||||||
'(-H --hold)'{-H,--hold}'[remain open after child process exits]' \
|
'(-H --hold)'{-H,--hold}'[remain open after child process exits]' \
|
||||||
'(-p --print-pid)'{-p,--print-pid}'[print PID to this file or FD when up and running (server mode only)]:pidfile:_files' \
|
'(-p --print-pid)'{-p,--print-pid}'[print PID to this file or FD when up and running (server mode only)]:pidfile:_files' \
|
||||||
'(-d --log-level)'{-d,--log-level}'[log level (info)]:loglevel:(info warning error none)' \
|
'(-d --log-level)'{-d,--log-level}'[log level (warning)]:loglevel:(info warning error none)' \
|
||||||
'(-l --log-colorize)'{-l,--log-colorize}'[enable or disable colorization of log output on stderr]:logcolor:(never always auto)' \
|
'(-l --log-colorize)'{-l,--log-colorize}'[enable or disable colorization of log output on stderr]:logcolor:(never always auto)' \
|
||||||
'(-S --log-no-syslog)'{-s,--log-no-syslog}'[disable syslog logging (server mode only)]' \
|
'(-S --log-no-syslog)'{-s,--log-no-syslog}'[disable syslog logging (server mode only)]' \
|
||||||
'(-v --version)'{-v,--version}'[show the version number and quit]' \
|
'(-v --version)'{-v,--version}'[show the version number and quit]' \
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ _arguments \
|
||||||
'(-N --no-wait)'{-N,--no-wait}'[detach the client process from the running terminal, exiting immediately]' \
|
'(-N --no-wait)'{-N,--no-wait}'[detach the client process from the running terminal, exiting immediately]' \
|
||||||
'(-o --override)'{-o,--override}'[configuration option to override, in form SECTION.KEY=VALUE]:()' \
|
'(-o --override)'{-o,--override}'[configuration option to override, in form SECTION.KEY=VALUE]:()' \
|
||||||
'(-E --client-environment)'{-E,--client-environment}"[child process inherits footclient's environment, instead of the server's]" \
|
'(-E --client-environment)'{-E,--client-environment}"[child process inherits footclient's environment, instead of the server's]" \
|
||||||
'(-d --log-level)'{-d,--log-level}'[log level (info)]:loglevel:(info warning error none)' \
|
'(-d --log-level)'{-d,--log-level}'[log level (warning)]:loglevel:(info warning error none)' \
|
||||||
'(-l --log-colorize)'{-l,--log-colorize}'[enable or disable colorization of log output on stderr]:logcolor:(never always auto)' \
|
'(-l --log-colorize)'{-l,--log-colorize}'[enable or disable colorization of log output on stderr]:logcolor:(never always auto)' \
|
||||||
'(-v --version)'{-v,--version}'[show the version number and quit]' \
|
'(-v --version)'{-v,--version}'[show the version number and quit]' \
|
||||||
'(-h --help)'{-h,--help}'[show help message and quit]' \
|
'(-h --help)'{-h,--help}'[show help message and quit]' \
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ the foot command line
|
||||||
|
|
||||||
*-d*,*--log-level*={*info*,*warning*,*error*,*none*}
|
*-d*,*--log-level*={*info*,*warning*,*error*,*none*}
|
||||||
Log level, used both for log output on stderr as well as
|
Log level, used both for log output on stderr as well as
|
||||||
syslog. Default: _info_.
|
syslog. Default: _warning_.
|
||||||
|
|
||||||
*-l*,*--log-colorize*=[{*never*,*always*,*auto*}]
|
*-l*,*--log-colorize*=[{*never*,*always*,*auto*}]
|
||||||
Enables or disables colorization of log output on stderr. Default:
|
Enables or disables colorization of log output on stderr. Default:
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ terminal has terminated.
|
||||||
|
|
||||||
*-d*,*--log-level*={*info*,*warning*,*error*,*none*}
|
*-d*,*--log-level*={*info*,*warning*,*error*,*none*}
|
||||||
Log level, used both for log output on stderr as well as
|
Log level, used both for log output on stderr as well as
|
||||||
syslog. Default: _info_.
|
syslog. Default: _warning_.
|
||||||
|
|
||||||
*-l*,*--log-colorize*=[{*never*,*always*,*auto*}]
|
*-l*,*--log-colorize*=[{*never*,*always*,*auto*}]
|
||||||
Enables or disables colorization of log output on stderr.
|
Enables or disables colorization of log output on stderr.
|
||||||
|
|
|
||||||
4
main.c
4
main.c
|
|
@ -83,7 +83,7 @@ print_usage(const char *prog_name)
|
||||||
" Without PATH, $XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock will be used.\n"
|
" Without PATH, $XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock will be used.\n"
|
||||||
" -H,--hold remain open after child process exits\n"
|
" -H,--hold remain open after child process exits\n"
|
||||||
" -p,--print-pid=FILE|FD print PID to file or FD (only applicable in server mode)\n"
|
" -p,--print-pid=FILE|FD print PID to file or FD (only applicable in server mode)\n"
|
||||||
" -d,--log-level={info|warning|error|none} log level (info)\n"
|
" -d,--log-level={info|warning|error|none} log level (warning)\n"
|
||||||
" -l,--log-colorize=[{never|always|auto}] enable/disable colorization of log output on stderr\n"
|
" -l,--log-colorize=[{never|always|auto}] enable/disable colorization of log output on stderr\n"
|
||||||
" -s,--log-no-syslog disable syslog logging (only applicable in server mode)\n"
|
" -s,--log-no-syslog disable syslog logging (only applicable in server mode)\n"
|
||||||
" -v,--version show the version number and quit\n"
|
" -v,--version show the version number and quit\n"
|
||||||
|
|
@ -236,7 +236,7 @@ main(int argc, char *const *argv)
|
||||||
bool fullscreen = false;
|
bool fullscreen = false;
|
||||||
bool unlink_pid_file = false;
|
bool unlink_pid_file = false;
|
||||||
const char *pid_file = NULL;
|
const char *pid_file = NULL;
|
||||||
enum log_class log_level = LOG_CLASS_INFO;
|
enum log_class log_level = LOG_CLASS_WARNING;
|
||||||
enum log_colorize log_colorize = LOG_COLORIZE_AUTO;
|
enum log_colorize log_colorize = LOG_COLORIZE_AUTO;
|
||||||
bool log_syslog = true;
|
bool log_syslog = true;
|
||||||
user_notifications_t user_notifications = tll_init();
|
user_notifications_t user_notifications = tll_init();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue