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

Colors in Xcode are applied only to some entries #681

Closed
andriichernenko opened this issue Jan 20, 2016 · 5 comments
Closed

Colors in Xcode are applied only to some entries #681

andriichernenko opened this issue Jan 20, 2016 · 5 comments
Labels

Comments

@andriichernenko
Copy link

I am using Xcode 7.2 (7C68) with the latest versions of XcodeColors plugin and CocoaLumberjack/Swift pod.

Here is how I set up logging:

private func setUpLogging() {
    DDLog.addLogger(DDASLLogger.sharedInstance(), withLevel: .Warning)

    let ttyLogger = DDTTYLogger.sharedInstance()
    ttyLogger.colorsEnabled = true
    ttyLogger.setForegroundColor(UIColor(red: 0.0, green: 0.5, blue: 0, alpha: 1.0), backgroundColor: nil, forFlag: .Info)
    ttyLogger.setForegroundColor(UIColor(red: 0.0, green: 0, blue: 0.7, alpha: 1.0), backgroundColor: nil, forFlag: .Debug)
    ttyLogger.setForegroundColor(UIColor(red: 0.5, green: 0.5, blue: 0.5, alpha: 1.0), backgroundColor: nil, forFlag: .Verbose)

    #if DEBUG
        let logLevel: DDLogLevel = .Verbose
    #else
        let logLevel: DDLogLevel = .Off
    #endif
    DDLog.addLogger(ttyLogger, withLevel: logLevel)
}

The problem is that color is applied only to some log entries, others remain black. It is reproduced both for Warn (which is colored by default) and for Debug (for which I set up color myself).

@rivera-ernesto
Copy link
Member

I had a similar problem where some color combinations are not picked up by Xcode's console. Could you try some color variations?

@andriichernenko
Copy link
Author

@rivera-ernesto I tried setting UIColor.blueColor() and removing other color customizations:

ttyLogger.setForegroundColor(UIColor.blueColor(), backgroundColor: nil, forFlag: .Debug)

the issue persists.

@andriichernenko
Copy link
Author

Here's how the raw console output in AppCode looks (attached as screenshot to make sure ESC characters are visible):
screen shot 2016-01-20 at 14 04 17

Seems a bit inconsistent to me.
Not sure I can say which lines of the above are in color, it is applied to different lines every time I run the app.

@andriichernenko
Copy link
Author

This problem was caused by MCLog plugin. After I removed it, everything works just fine.

@rivera-ernesto
Copy link
Member

Thanks for posting back your findings for others to see!

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

No branches or pull requests

2 participants