SolvedCocoaLumberjack Xcode 9 beta 3 breaks the new os_log logger

Getting the following errors DDOSLogger.m:

DDOSLogger.m:58:17: Static_assert failed "format argument must be a string constant"
DDOSLogger.m:62:17: Static_assert failed "format argument must be a string constant"
DDOSLogger.m:67:17: Static_assert failed "format argument must be a string constant"

The documentation for the format parameter says:

A format string to generate a human-readable log message when the log line is decoded. This string must be a constant string, not dynamically generated. Supports all standard printf types and %@ (objects).

18 Answers

✔️Accepted Answer

if (message) {
        const char *msg = [message UTF8String];
        
        switch (logMessage->_flag) {
            case DDLogFlagError     :
                os_log_error(OS_LOG_DEFAULT, "%s", msg);
                break;
            case DDLogFlagWarning   :
            case DDLogFlagInfo      :
                os_log_info(OS_LOG_DEFAULT, "%s", msg);
                break;
            case DDLogFlagDebug     :
            case DDLogFlagVerbose   :
            default                 :
                os_log_debug(OS_LOG_DEFAULT, "%s", msg);
                break;
        }
    }

Other Answers:

We're seeing this too — I made a fork that comments out the parts that don't work, since we weren't using the DDOSLogger in our project anyway. Feel free to use this if you need a temporary work around

pod 'CocoaLumberjack', :git => 'git@github.com:supertop/CocoaLumberjack.git', :commit => '3443875e'

More Issues: