]> git.tuebingen.mpg.de Git - paraslash.git/commit
server/audiod: Don't parse loglevel argument unnecessarily.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 19 Oct 2021 19:28:30 +0000 (21:28 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 2 Jul 2022 19:29:07 +0000 (21:29 +0200)
commita0cd2ac59b891751067512dce77cf6223104932f
tree84d087cd16a7e4d09219e00a2070f3a1cd13cc3e
parentf0b8296a0635e74aaa58767e513eed226504ec34
server/audiod: Don't parse loglevel argument unnecessarily.

Currently the severity string (debug, info, etc.) given to --loglevel
is parsed twice: Once by lopsub, which returns the loglevel as the
index into the array of severity strings. We turn this index into a
string and pass the string to daemon_set_loglevel() which parses the
string again to turn it back into a log level value (which happens
to coincide with the index value).

Clean this up by letting daemon_set_loglevel() receive a log level
value rather than a severity string. This also allows us to remove
the now unused ENUM_STRING_VAL() macro from audiod.c.
audiod.c
daemon.c
daemon.h
server.c