Cocoalumberjack+xcodecolor (output color-colored logs) problems encountered during the installation process

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.