我在代码中加了
setenv("XcodeColors", "YES", 0);和
[[DDTTYLogger sharedInstance] setColorsEnabled:YES];但是打印出的信息还是黑色的,然后去https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/XcodeColors.md仔细看了看,有这么一段
You can fix it in a few seconds. Here's how.
- In Xcode bring up the Scheme Editor (Product -> Edit Scheme...)
- Select "Run" (on the left), and then the "Arguments" tab
- Add a new Environment Variable named "XcodeColors", with a value of "YES"