Skip to contentSkip to conversation

Where should a Loglevel setting be implemented?

DISCUSSION Oskar Roesler 1 participant 1 message Sep 24, 2025

lore
Share & tools
lore
#0 lore raw

Hi,

currently, the logging of connmand is very verbose. Connman uses the vsyslog() function internally, but there isn't any play where setlogmask() is executed, so even the info level is always printed. I want to make the logging level configurable. Problem is that currently logging is initialized before the configuration is happening (which eg is necessary to log config errors). This prevents the straighforward way of having a LogLevel config option & setting the logmask during loggin initialization. I have 2 options in mind to fix this:

1. Use an optional flag to set the loglevel. Some flag handling is already done before the call to any init function, the value of the flag could be handled similar to the debug flag.

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

Which approach is preferred by upstream? Do you have any other idea how to do this better?

Best regards,

Oskar Roesler