Where should a Loglevel setting be implemented?

Oskar Roesler <[email protected]> Wed, 24 Sep 2025 15:39:51 +0200
Newsgroups dev.linux.lists.connman
Message-ID <[email protected]>
Hi,


currently, the logging of connmand is very verbose. Connman uses the=20
vsyslog() function internally, but there isn't any play where setlogmask()=20=

is executed, so even the info level is always printed. I want to make the=20
logging level configurable. Problem is that currently logging is=20
initialized before the configuration is happening (which eg is necessary to=20=

log config errors). This prevents the straighforward way of having a=20
LogLevel config option & setting the logmask during loggin initialization. =20=

I have 2 options in mind to fix this:

1. Use an optional flag to set the loglevel. Some flag handling is already=20=

done before the call to any init function, the value of the flag could be=20
handled similar to the debug flag.

2. Add another init function for configuring the loglevel after=20
__connman_config_init(). The loglevel could be specified as a key invthe=20
setting, but connman would keep being verbose on startup. 2 init functions=20=

for logging may be less straightforward to read.


Which approach is preferred by upstream? Do you have any other idea how to=20=

do this better?

Best regards,

Oskar Roesler