I am using Lumberjack as my logging framework.
I have this definition…
#ifdef DEBUG
static const int ddLogLevel = LOG_LEVEL_DEBUG;
#else
static const int ddLogLevel = LOG_LEVEL_WARN;
#endif
and this is my log statement…
DDLogInfo(@"Starting");
However when I look at the Console.app it shows this message as a WARNING instead of INFO like ASL can show. Is there something else that I need to do?
This does allow the statement to not be logged when not in DEBUG mode, so that is working as advertised.
This is the expected behavior. The DDASLLogger map the Debug to ASL's Warning level, Info to Error etc. Thats because by default, ASL will filter Notice level and above.
(In case DDLogInfo prints Warning, then you are using an older version of CocoaLumberjack)
Apple System Log documentation says:
The default filter mask is ASL_FILTER_MASK_UPTO(ASL_LEVEL_NOTICE). This means that by default, and in the absence of remote-control changes (described below), ASL_LEVEL_DEBUG and ASL_LEVEL_INFO priority level messages are not sent to the server.
You could try and write your own custom ASL logger.
But I suggest that you will add a custom formatter to the ASL logger that will add the actual log level (faster approache).