teamd: add an option to force log output to stdout, stderr or syslog

By default, libdaemon prints the logs to stderr, and switches to syslog
if the precess daemonizes.

When some users, e.g. NetworkManager, run teamd foreground, the logs printed
in syslog will as coming from NetworkManager, with mixed NetworkManager's
own debug logs, which makes people feel a mess and hard to debug.

Add option -l to support force teamd log output to stdout, stderr or
syslog. Also add a global env TEAM_LOG_OUTPUT, which could be used for
old version compatibility.

Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
3 files changed