Encountered in the installation of various pits, (the use of the PCH file used here and to solve the problem cannot be introduced, can refer to the article in the morning)
One (xcodecolor installation), download Xcodeclolor plugin on github, and install, after Xcode completely exits, open the plugin, then compile and run, then completely exit, open the plugin, Xcode will prompt whether to install the plugin (choose Lo AD), Then open, select Testxcodecolors, run
At this point, the console will have a colored log output. If not, do not proceed. Repeat the previous steps (preferably in ~/library/application support/developer/shared/xcode/plug-ins/to remove the Xcodecolor plugin).
Second, (Installation of Cocoalumberjack)
1, Cocoalumberjack installation directly using the Cocoapod installation on the line.
2. Then add the following code to new Common.h in the demo and import
#import "CocoaLumberjack.h"
:
#ifdef DEBUG
static const int ddloglevel = Ddloglevelverbose;
#else
static const int ddloglevel = Ddloglevelerror;
#endif
(There are other versions of this code, but I used the one that went wrong, so I used it.)
3. Then create a new. pch file, import the Common.h file into it (the process also has errors, but the confused don't know how to solve it)
4. Add this code in the Didfinishlaunchingwithoptions: (Nsdictionary *) Launchoptions method
[Ddlog Addlogger:[ddasllogger sharedinstance];
[Ddlog Addlogger:[ddttylogger sharedinstance];
[[Ddttylogger sharedinstance] setcolorsenabled:yes];
5. Use the following output where needed to see the output of the color log in the console.
Ddlogerror (@ "error message"); Red
Ddlogwarn (@ "Warning"); Orange
Ddloginfo (@ "prompt message"); Default is Black
Ddlogverbose (@ "more information"); Default is Black
6, there is also a configuration can not be less
Then there should be no problem. If there is anything to add to Huanhuan Ying,,,,
Have a picture of the truth (but have not found out what the benefits of doing it)
Cocoalumberjack+xcodecolor (output color-colored logs) problems encountered during the installation process