Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
campaignd: Log messages to a new log domain of our own
Until now, campaignd logged its diagnostics to the network log domain with the show_names parameter (of logger::operator()()) set to false so as to avoid showing the log level or domain names in stderr. There are two issues with this approach: * In order to tell the difference between informational and error messages, the messages themselves need to include a severity label in some form, which defeats half the point of using our standard logging facilities (though not the other half, which is having timestamps). * In the event that messages from other domains appear in stderr (which can only happen if their severity is 'warning' or more at this time, since campaignd doesn't change the default severity configuration), the log could become a jumbled mess. Note that wesnothd (which produces a larger volume of diagnostics all the time) does already use a log domain of its own with no overidden show_names option. Giving campaignd its own log domain should allow us to add more optional diagnostics later if needed, and right now it allows us to do away with the unwieldy severity labels in the log messages themselves in favor of choosing the right logger in the invocation -- although this last point is beyond the scope of this introductory commit. This commit keeps our previous logging macro, LOG_CS, just replacing the log domain and severity (info instead of err) and dropping the overridden show_names value. Later I'll take care of choosing more relevant severities for different messages. For now, we do like wesnothd and select the info severity as the default during initialization so the messages can still display.
- Loading branch information