You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a set of c++ modules with a custom logging framework that prints with a log zone prefix that can be shared between 1 or more c++ modules.
myapp: DEFAULT main:42 -- main message.
myapp: CONNECTIVITY test:44 -- another log message.
myapp: SYSTEM foo:45 -- another log message.
The logzones prefixes provides a quick way to filter the log output.
The module files sets a zone name definition in the top of the cpp file and prints to a default logger where the zone definition gets prefixed. The default zone will get used if one hasn't been set in the cpp file.
I have checked the spdlog documentation, but can't seem to find a way to do this, except by creating a logger by cloning the default and changing the logger name. This would require multiple lines for each module instead of just defining which log zone to use and print to default logger.
So do anyone have an idea on how to do this? 😃
The text was updated successfully, but these errors were encountered:
spdlog does not provide the ability for loggers to reference additional information from the outside.
The only way to do this would be to treat the logger name as a zone.
See also #617
We have a set of c++ modules with a custom logging framework that prints with a log zone prefix that can be shared between 1 or more c++ modules.
The logzones prefixes provides a quick way to filter the log output.
The module files sets a zone name definition in the top of the cpp file and prints to a default logger where the zone definition gets prefixed. The default zone will get used if one hasn't been set in the cpp file.
I have checked the spdlog documentation, but can't seem to find a way to do this, except by creating a logger by cloning the default and changing the logger name. This would require multiple lines for each module instead of just defining which log zone to use and print to default logger.
So do anyone have an idea on how to do this? 😃
The text was updated successfully, but these errors were encountered: