The Github Readme mentions possibility of colours in debug. Despite configuration of the XcodeColors plugin, what else is needed to get colorised output there?
Asked
Active
Viewed 317 times
2 Answers
0
Use:
log.xcodeColorsEnabled = true
when setting up your log object to explicitly turn on colours. Relying on the environment variable isn't great for iOS apps since you have to add it manually in your project. The environment variable works better for OS X apps since you can set it in your .profile etc and have it work for all projects.

Dave Wood
- 13,143
- 2
- 59
- 67
-
Still it does not work. I cannot run the Demo shipped with it. Neither iOS or Mac OS. – Sunil Chauhan Jul 13 '16 at 15:30
-
And you have the XcodeColors plug-in installed? Note that plug-ins (including XcodeColors) do not work in Xcode 8. – Dave Wood Jul 13 '16 at 17:41
-
No, I don't have that plugin. Do I have to? – Sunil Chauhan Jul 13 '16 at 17:43
-
Yes. The XcodeColors plug-in is what gives Xcode the ability to display colours in the console log. XCGLogger then includes the codes for XcodeColors to use. – Dave Wood Jul 13 '16 at 17:46
-
ah, okey. Got it. From the doc, I thought it was some plugin that is supported, and not required. Thanks. – Sunil Chauhan Jul 13 '16 at 17:47
0
For iOS projects, the current version of Xcode (7.3) and XCGLogger (3.3) requires the following line as hinted at by Dave Wood:
log.xcodeColorsEnabled = true
You can put it in didFinishLaunchingWithOptions in AppDelegate.swift after
let log = XCGLogger.defaultInstance()
log.setup(.Debug, showThreadName: true, showLogLevel: true, showFileNames: true, showLineNumbers: true, writeToFile: nil, fileLogLevel: nil)
and then test with
log.info("App started")

Orest Tarasiuk
- 36
- 4