mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-27 07:58:07 -04:00
log: add LOG_CLASS_NONE and use as initializer for log_level
This means that logging will be completely disabled until log_init()
has been called, which is useful to prevent log spam when running
UNITTEST{} blocks in debug builds.
Note that this doesn't change the default log level at runtime, which
was already being set to LOG_CLASS_INFO in main.c and client.c.
The new log level is also exposed to the command-line interface as
`--log-level=none`, which allows disabling logging entirely.
This commit is contained in:
parent
0ff8f72a9d
commit
5dca0458a0
14 changed files with 113 additions and 93 deletions
|
|
@ -68,7 +68,7 @@ _foot()
|
|||
which fc-list > /dev/null || return 1
|
||||
COMPREPLY=( $(compgen -W "$(fc-list : family | sed 's/,/\n/g' | uniq | tr -d ' ')" -- ${cur}) )
|
||||
elif [[ ${prev} == '--log-level' ]] ; then
|
||||
COMPREPLY=( $(compgen -W "error warning info" -- ${cur}) )
|
||||
COMPREPLY=( $(compgen -W "none error warning info" -- ${cur}) )
|
||||
elif [[ ${prev} == '--log-colorize' ]] ; then
|
||||
COMPREPLY=( $(compgen -W "never always auto" -- ${cur}) )
|
||||
elif [[ ${prev} =~ ^(--app-id|--help|--override|--title|--version|--window-size-chars|--window-size-pixels|--check-config)$ ]] ; then
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ _footclient()
|
|||
which toe > /dev/null || return 1
|
||||
COMPREPLY=( $(compgen -W "$(toe -a | awk '$1 ~ /[+]/ {next}; {print $1}')" -- ${cur}) )
|
||||
elif [[ ${prev} == '--log-level' ]] ; then
|
||||
COMPREPLY=( $(compgen -W "error warning info" -- ${cur}) )
|
||||
COMPREPLY=( $(compgen -W "none error warning info" -- ${cur}) )
|
||||
elif [[ ${prev} == '--log-colorize' ]] ; then
|
||||
COMPREPLY=( $(compgen -W "never always auto" -- ${cur}) )
|
||||
elif [[ ${prev} =~ ^(--app-id|--help|--override|--title|--version|--window-size-chars|--window-size-pixels|)$ ]] ; then
|
||||
|
|
|
|||
|
|
@ -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 -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 -x -s d -l log-level -a "info warning error" -d "log-level (info)"
|
||||
complete -c foot -x -s d -l log-level -a "info warning error none" -d "log-level (info)"
|
||||
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 v -l version -d "show the version number and quit"
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ complete -c footclient -F -s s -l server-socket
|
|||
complete -c footclient -s H -l hold -d "remain open after child process exits"
|
||||
complete -c footclient -s N -l no-wait -d "detach the client process from the running terminal, exiting immediately"
|
||||
complete -c footclient -x -s o -l override -d "configuration option to override, in form SECTION.KEY=VALUE"
|
||||
complete -c footclient -x -s d -l log-level -a "info warning error" -d "log-level (info)"
|
||||
complete -c footclient -x -s d -l log-level -a "info warning error none" -d "log-level (info)"
|
||||
complete -c footclient -x -s l -l log-colorize -a "always never auto" -d "enable or disable colorization of log output on stderr"
|
||||
complete -c footclient -s v -l version -d "show the version number and quit"
|
||||
complete -c footclient -s h -l help -d "show help message and quit"
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ _arguments \
|
|||
'(-s --server)'{-s,--server}'[run as server; open terminals by running footclient]:server:_files' \
|
||||
'(-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' \
|
||||
'(-d --log-level)'{-d,--log-level}'[log level (info)]:loglevel:(info warning error)' \
|
||||
'(-d --log-level)'{-d,--log-level}'[log level (info)]:loglevel:(info warning error none)' \
|
||||
'(-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)]' \
|
||||
'(-v --version)'{-v,--version}'[show the version number and quit]' \
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ _arguments \
|
|||
'(-H --hold)'{-H,--hold}'[remain open after child process exits]' \
|
||||
'(-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]:()' \
|
||||
'(-d --log-level)'{-d,--log-level}'[log level (info)]:loglevel:(info warning error)' \
|
||||
'(-d --log-level)'{-d,--log-level}'[log level (info)]:loglevel:(info warning error none)' \
|
||||
'(-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]' \
|
||||
'(-h --help)'{-h,--help}'[show help message and quit]' \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue