Mon, Dec 02, 2019 at 09:28:17AM CET, liuhangbin(a)gmail.com wrote:
Recently some users reported that they start to see debug messages in
their
syslogs even with daemon_verbosity_level = LOG_INFO and without -g option.
Actually this issue is there at the begining, the user would see the debug
messages if they run teamd with -d option. The reason that most users did
not notice this is because they are using libteam via NetworkManager, and
NetworkManager run libteam in frontend.
But after commit e47d5db53873 ("teamd: add an option to force log
output to stdout, stderr or syslog"), NetworkManager will set
TEAM_LOG_OUTPUT=syslog in the environment. At the same time libdaemon
does not filter log levels if we use syslog(see function daemon_logv in
libdaemon). Then all the users would see the debug messages suddenly and
feels annoying.
And here is the quote for daemon_set_verbosity() from libdaemon/dlog.h
"""
Allows to decide which messages to output on standard output/error
streams. All messages are logged to syslog and this setting does
not influence that.
"""
Since we should not limit how our user(NM) used libteam. And libdaemon
is intend to not filter logs if use syslog. We'd better filter the
debug message ourselves, like via -g option. So I would prefer to
move all teamd_log_dbg to teamd_log_dbgx. After that, the user could
decide whether to enable debug or not by themselves with -g option.
v2: wapper teamd_log_dbg with teamd_log_dbgx as Jiri suggested.
Move TEAMD_BUG to use daemon_log directly.
Signed-off-by: Hangbin Liu <liuhangbin(a)gmail.com>
applied, thanks.
Next time, please put the "v2" notes under "---"