Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors in logMessage #11

Open
sbatururimi opened this issue Nov 11, 2014 · 0 comments
Open

errors in logMessage #11

sbatururimi opened this issue Nov 11, 2014 · 0 comments

Comments

@sbatururimi
Copy link

I've been faced to some error due to the recent version of CocoaLumberjack. Below my version of fixing bugs

- (void)logMessage:(DDLogMessage *)logMessage
{
    NSString *logMsg = logMessage.message;

    if (_logFormatter)
    {
        // formatting is supported but not encouraged!
        logMsg = [_logFormatter formatLogMessage:logMessage];
    }

    if (logMsg)
    {
        int nsloggerLogLevel;
        switch (logMessage.flag)
        {
                // NSLogger log levels start a 0, the bigger the number,
                // the more specific / detailed the trace is meant to be
            case LOG_FLAG_ERROR : nsloggerLogLevel = 0; break;
            case LOG_FLAG_WARN  : nsloggerLogLevel = 1; break;
            case LOG_FLAG_INFO  : nsloggerLogLevel = 2; break;
            default : nsloggerLogLevel = 3; break;
        }



        LogMessageF([logMessage.file UTF8String], logMessage.line, [logMessage.function UTF8String], logMessage.fileName, nsloggerLogLevel, @"%@", logMsg);

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant