libteam: wapper teamd_log_dbg with teamd_log_dbgx
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
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.
Signed-off-by: Hangbin Liu <email@example.com>
Signed-off-by: Jiri Pirko <firstname.lastname@example.org>
16 files changed