Giter Club home page Giter Club logo

xcodecolors's Introduction

XcodeColors allows you to use colors in the Xcode debugging console.
It's designed to aid in the debugging process. For example:

  • Make error messages stand out by printing them out in red.
  • Use different colors for logically separate parts of your code.

You're not limited to a restricted color palate.
You can specify, in your source code, the exact RGB values you'd like to use.
You can specify foreground and/or background color(s).

XcodeColors is a simple plugin for Xcode 3, 4, 5, 6 & 7


XcodeColors installation instructions for Xcode 4, 5, 6 & 7:

  • Download or clone the repository.
  • Open the XcodeColors project with Xcode
  • If compiling for Xcode 4, then change the schemes to use the Xcode4 build configuration (instead of the Xcode5 build configuration which is the default)
  • Compile the XcodeColors target.
    When you do this, the Xcode plugin is automatically copied to the proper location.
    This is done via the build settings. You can validate the plugin was copied to "~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XcodeColors.xcplugin"
  • Now completely Quit Xcode
  • Re-Launch Xcode, and re-open the XcodeColors project
  • Now run the TestXcodeColors target.
    This will test your installation, and you should see colors in your Xcode console.

Did you upgrade Xcode and now XcodeColors is "broken"? Get the fix here: XcodeUpdates.

$ ./update_compat.sh

XcodeColors installation instructions for Xcode 3:

Wow, you're still running Xcode 3?

See this page for installation instructions:
http://deepitpro.com/en/articles/XcodeColors/info/index.shtml


How to use XcodeColors

There are 3 ways to use XcodeColors:

  1. Manually specify the colors inside NSLog (or create custom macros)
  2. Use CocoaLumberjack (for Objective-C & Swift projects)
  3. Use CleanroomLogger (for Swift projects)

Option 1: Manual Use / Custom Macros

  • Testing to see if XcodeColors is installed and enabled:

    char *xcode_colors = getenv("XcodeColors");
    if (xcode_colors && (strcmp(xcode_colors, "YES") == 0))
    {
        // XcodeColors is installed and enabled!
    }
  • Enabling / Disabling XcodeColors

    setenv("XcodeColors", "YES", 0); // Enables XcodeColors (you obviously have to install it too)
    
    setenv("XcodeColors", "NO", 0); // Disables XcodeColors
  • Using XcodeColors

    The following is copied from the top of the XcodeColors.m file:

    // How to apply color formatting to your log statements:
    // 
    // To set the foreground color:
    // Insert the ESCAPE into your string, followed by "fg124,12,255;" where r=124, g=12, b=255.
    // 
    // To set the background color:
    // Insert the ESCAPE into your string, followed by "bg12,24,36;" where r=12, g=24, b=36.
    // 
    // To reset the foreground color (to default value):
    // Insert the ESCAPE into your string, followed by "fg;"
    // 
    // To reset the background color (to default value):
    // Insert the ESCAPE into your string, followed by "bg;"
    // 
    // To reset the foreground and background color (to default values) in one operation:
    // Insert the ESCAPE into your string, followed by ";"
    
    #define XCODE_COLORS_ESCAPE @"\033["
    
    #define XCODE_COLORS_RESET_FG  XCODE_COLORS_ESCAPE @"fg;" // Clear any foreground color
    #define XCODE_COLORS_RESET_BG  XCODE_COLORS_ESCAPE @"bg;" // Clear any background color
    #define XCODE_COLORS_RESET     XCODE_COLORS_ESCAPE @";"   // Clear any foreground or background color

    To manually colorize your log statements, you surround the log statements with the color options:

    NSLog(XCODE_COLORS_ESCAPE @"fg0,0,255;" @"Blue text" XCODE_COLORS_RESET);
    
    NSLog(XCODE_COLORS_ESCAPE @"bg220,0,0;" @"Red background" XCODE_COLORS_RESET);
    
    NSLog(XCODE_COLORS_ESCAPE @"fg0,0,255;"
          XCODE_COLORS_ESCAPE @"bg220,0,0;"
          @"Blue text on red background"
          XCODE_COLORS_RESET);
    
    NSLog(XCODE_COLORS_ESCAPE @"fg209,57,168;" @"You can supply your own RGB values!" XCODE_COLORS_RESET);
  • Defining macros

    You may prefer to use macros to keep your code looking a bit cleaner.
    Here's an example to get you started:

    #define LogBlue(frmt, ...) NSLog((XCODE_COLORS_ESCAPE @"fg0,0,255;" frmt XCODE_COLORS_RESET), ##__VA_ARGS__)
    #define LogRed(frmt, ...) NSLog((XCODE_COLORS_ESCAPE @"fg255,0,0;" frmt XCODE_COLORS_RESET), ##__VA_ARGS__)

    And then you could just replace NSLog with LogBlue like so:

    LogBlue(@"Configuring sprocket...");
    LogRed(@"Sprocket error: %@", error);
  • Swift struct with static methods

    struct ColorLog {
    	static let ESCAPE = "\u{001b}["
    
    static let RESET_FG = ESCAPE + "fg;" // Clear any foreground color
    	static let RESET_BG = ESCAPE + "bg;" // Clear any background color
    	static let RESET = ESCAPE + ";"   // Clear any foreground or background color
    
    static func red<T>(object: T) {
        print("\(ESCAPE)fg255,0,0;\(object)\(RESET)")
    }
    
    static func green<T>(object: T) {
        print("\(ESCAPE)fg0,255,0;\(object)\(RESET)")
    }
    
    static func blue<T>(object: T) {
        print("\(ESCAPE)fg0,0,255;\(object)\(RESET)")
    }
    
    static func yellow<T>(object: T) {
        print("\(ESCAPE)fg255,255,0;\(object)\(RESET)")
    }
    
    static func purple<T>(object: T) {
        print("\(ESCAPE)fg255,0,255;\(object)\(RESET)")
    }
    
    static func cyan<T>(object: T) {
        print("\(ESCAPE)fg0,255,255;\(object)\(RESET)")
    }
    }

And then you can log within a Swift method like so:

```Swift
ColorLog.red("This is a log.")
ColorLog.blue("Number one hundred: \(100).")
```

Option 2: CocoaLumberjack

The CocoaLumberjack framework natively supports XcodeColors!
Lumberjack is a fast & simple, yet powerful & flexible logging framework for Mac and iOS.

From its GitHub page:

Lumberjack is similar in concept to other popular logging frameworks such as log4j, yet is designed specifically for Objective-C, and takes advantage of features such as multi-threading, grand central dispatch (if available), lockless atomic operations, and the dynamic nature of the Objective-C runtime.

In most cases it is an order of magnitude faster than NSLog.

It's super easy to use XcodeColors with Lumberjack!

And if color isn't available (e.g. XcodeColors isn't installed), then the framework just automatically does the right thing. So if you install XcodeColors on your machine, and enable colors in your team project, your teammates (without XcodeColors... yet) won't suffer, or even notice.

Plus Lumberjack colors automatically work if you run your application from within a terminal! (E.g. Terminal.app, not Xcode) If your terminal supports color (xterm-color or xterm-256color) like the Terminal.app in Lion, then Lumberjack automatically maps your color customizations to the closest available color supported by the shell!

// Enable XcodeColors 
setenv("XcodeColors", "YES", 0);

// Standard lumberjack initialization
[DDLog addLogger:[DDTTYLogger sharedInstance]];

// And then enable colors
[[DDTTYLogger sharedInstance] setColorsEnabled:YES];

// Check out default colors:
// Error : Red
// Warn  : Orange

DDLogError(@"Paper jam");                              // Red
DDLogWarn(@"Toner is low");                            // Orange
DDLogInfo(@"Warming up printer (pre-customization)");  // Default (black)
DDLogVerbose(@"Intializing protcol x26");              // Default (black)

// Now let's do some customization:
// Info  : Pink

#if TARGET_OS_IPHONE
UIColor *pink = [UIColor colorWithRed:(255/255.0) green:(58/255.0) blue:(159/255.0) alpha:1.0];
#else
NSColor *pink = [NSColor colorWithCalibratedRed:(255/255.0) green:(58/255.0) blue:(159/255.0) alpha:1.0];
#endif

[[DDTTYLogger sharedInstance] setForegroundColor:pink backgroundColor:nil forFlag:DDLogFlagInfo];

DDLogInfo(@"Warming up printer (post-customization)"); // Pink !

Option 3: CleanroomLogger

CleanroomLogger is a popular pure-Swift logging API for iOS, Mac OS X, tvOS and watchOS that is designed to be simple, extensible, lightweight and performant.

CleanroomLogger is a real console logger, meaning that it writes to the Apple System Log (ASL) facility and not just to standard output.

XcodeColors support is included in CleanroomLogger, and by default, when the XcodeColors environment variable is set to YES, CleanroomLogger will colorize log output based on the severity of the message:

CleanroomLogger's default XcodeColors log severity colorization

Let's say you had an AppDelegate.swift file with an import CleanroomLogger statement and the lines:

Log.verbose?.trace()
Log.debug?.value(self)
Log.info?.message("These pretzels are making me thirsty")
Log.warning?.message("The ocean called, they're running out of shrimp!")
Log.error?.message("The database connection failed")

With CleanroomLogger and XcodeColors, you would see colorized log output looking something like:

CleanroomLogger code example

CleanroomLogger lets developers supply their own ColorTable to customize the default color scheme. Default colorization can also be turned off entirely, and an XcodeColorsColorizer instance can be used to manually apply XcodeColors escape sequences to strings.

For further details, visit the CleanroomLogger API documentation.

xcodecolors's People

Contributors

amitaib avatar cjwirth avatar ctgreybeard avatar danskeel avatar demonnico avatar dwarven avatar gfontenot avatar isghe avatar jawwad avatar klaas avatar kreeger avatar nachosoto avatar norod avatar pwnified avatar readmecritic avatar reflejo avatar robbiehanson avatar rochefort avatar rvi avatar tomhamming avatar tommeier avatar zlargon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xcodecolors's Issues

Unable to create directory (Permission denied)

Create product structure

/bin/mkdir -p /Users/karl/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/XcodeColors.xcplugin/Contents
error: Unable to create directory: /Users/karl/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XcodeColors.xcplugin/Contents (Permission denied)

Colors sometimes work, sometimes not

For some log statements, the color is shown as specified. Then, the next log statement (exactly as the previous one in the same file) does not show a colored text.

I'm using Xcode 7 beta 4 for an iOS project.

Does not work outside of demo app

Hi,

Using Version 6.0 (6A313), and the demo app shows the colors, and the plugin is in plugin directory, and using proper UUID for this Xcode version, but output shows as this:

2014-10-12 09:35:25.997 WebScavenger[32543:70b] After building the XcodeColors plugin for the first time, you MUST RESTART XCODE.
2014-10-12 09:35:25.998 WebScavenger[32543:70b] If you still don't see colors below, please consult the README.
2014-10-12 09:35:25.999 WebScavenger[32543:70b]  [fg0,0,255;Blue text [;
2014-10-12 09:35:26.000 WebScavenger[32543:70b]  [bg220,0,0;Red background [;
2014-10-12 09:35:26.009 WebScavenger[32543:70b]  [fg0,0,255; [bg220,0,0;Blue text on red background [;
2014-10-12 09:35:26.010 WebScavenger[32543:70b]  [fg209,57,168;You can supply your own RGB values! [;
2014-10-12 09:35:26.011 WebScavenger[32543:70b]  [fg0,0,255;Blue text via macro [;

Turned colors on, as in docs:

[[DDTTYLogger sharedInstance] setColorsEnabled:YES]; // colors in terminal log

But nada.

Thanks,

Peter

Save to ship .xcplugin file?

Hi,

is it save & stable to just copy & paste a recently built XcodeColors.xcplugin file into Xcode's Plug-ins folder without being built on the machine?

I want to include that file in my SwiftyBeaver open source project (MIT license) for an easier installation, please contact me via Github or Twitter (@skreutzb) to discuss the details. Thanks!

Sebastian

Xcode 7 bug

I'm having problems with the colors in Xcode 7.0 - console prints all in white again.

Crash on "Add new scheme..."

OS X 10.0.1
Xcode Version 6.1 (6A1052d)

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000012

VM Regions Near 0x12:
--> 
    __TEXT                 0000000107744000-0000000107745000 [    4K] r-x/rwx SM=COW  /Applications/Xcode.app/Contents/MacOS/Xcode

Application Specific Information:
ProductBuildVersion: 6A1052d

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                 0x00007fff90f6b6e1 objc_retain + 17
1   ru.DeepIT.XcodeColors           0x000000010e604a43 -[XcodeColors_NSTextStorage fixAttributesInRange:] + 35 (XcodeColors.m:285)
2   com.apple.UIFoundation          0x00007fff8c81dcab __NSCreateRenderingContextForAttributedString + 188
3   com.apple.UIFoundation          0x00007fff8c81be71 __NSStringDrawingEngine + 14710
4   com.apple.UIFoundation          0x00007fff8c81d34f -[NSAttributedString(NSExtendedStringDrawing) boundingRectWithSize:options:context:] + 1068
5   com.apple.UIFoundation          0x00007fff8c81d9dc -[NSAttributedString(NSExtendedStringDrawing) boundingRectWithSize:options:] + 41
6   com.apple.AppKit                0x00007fff9723130f -[NSMenuItem _computeAttributedTitleSizeForTitle:] + 53
7   com.apple.AppKit                0x00007fff972314d2 -[NSMenuItem _cachedAttributedTitleSize] + 88
8   com.apple.AppKit                0x00007fff970b3f27 -[NSCarbonMenuImpl _carbonMeasureItemTextEvent:handlerCallRef:measuringHeight:] + 74
9   com.apple.AppKit                0x00007fff96efaeaf NSSLMMenuEventHandler + 664
10  com.apple.HIToolbox             0x00007fff9185f32c DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1260
11  com.apple.HIToolbox             0x00007fff9185e76e SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 386
12  com.apple.HIToolbox             0x00007fff9185e5e2 SendEventToEventTargetWithOptions + 43
13  com.apple.HIToolbox             0x00007fff918bec1b HIStandardMenuView::GetItemHeight(float*, float*, unsigned char*) + 391
14  com.apple.HIToolbox             0x00007fff918c0f3d HIStandardMenuView::HandleEvent(OpaqueEventHandlerCallRef*, OpaqueEventRef*) + 869
15  com.apple.HIToolbox             0x00007fff9185fbfb HIObject::EventHook(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 145
16  com.apple.HIToolbox             0x00007fff9185f32c DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1260
17  com.apple.HIToolbox             0x00007fff9185e76e SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 386
18  com.apple.HIToolbox             0x00007fff9185e5e2 SendEventToEventTargetWithOptions + 43
19  com.apple.HIToolbox             0x00007fff918609e9 MenuData::EventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 117
20  com.apple.HIToolbox             0x00007fff9185f32c DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1260
21  com.apple.HIToolbox             0x00007fff9185e76e SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 386
22  com.apple.HIToolbox             0x00007fff9185e5e2 SendEventToEventTargetWithOptions + 43
23  com.apple.HIToolbox             0x00007fff918beb4f HIStandardMenuView::GetItemHeight(float*, float*, unsigned char*) + 187
24  com.apple.HIToolbox             0x00007fff918bc5c3 HIStandardMenuView::GetOptimalSizeSelf(CGSize*, float*) + 719
25  com.apple.HIToolbox             0x00007fff918bc27c HIView::SendGetOptimalBounds(CGRect*, float*, CGSize*) + 416
26  com.apple.HIToolbox             0x00007fff918bc0af HIView::GetOptimalSize(CGSize*, float*, CGSize*) + 45
27  com.apple.HIToolbox             0x00007fff918bbfb5 HandleCalculateMenuSize(OpaqueEventRef*) + 154
28  com.apple.HIToolbox             0x00007fff91860ada MenuData::EventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 358
29  com.apple.HIToolbox             0x00007fff9185f32c DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1260
30  com.apple.HIToolbox             0x00007fff9185e76e SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 386
31  com.apple.HIToolbox             0x00007fff9185e5e2 SendEventToEventTargetWithOptions + 43
32  com.apple.HIToolbox             0x00007fff918bbd44 _CalcMenuSizeOnDevice(MenuData*, unsigned short, unsigned int, CGRect const*, unsigned int) + 763
33  com.apple.HIToolbox             0x00007fff91a0b742 PopUpMenuSelectCore(MenuData*, Point, double, Point, unsigned short, unsigned int, Rect const*, unsigned short, unsigned int, Rect const*, Rect const*, __CFDictionary const*, __CFString const*, OpaqueMenuRef**, unsigned short*) + 726
34  com.apple.HIToolbox             0x00007fff91a0ad44 _HandlePopUpMenuSelection8(OpaqueMenuRef*, OpaqueEventRef*, unsigned int, Point, unsigned short, unsigned int, Rect const*, unsigned short, Rect const*, Rect const*, __CFDictionary const*, __CFString const*, OpaqueMenuRef**, unsigned short*) + 633
35  com.apple.HIToolbox             0x00007fff91a0aedb _HandlePopUpMenuSelectionWithDictionary + 287
36  com.apple.AppKit                0x00007fff96f517ec _NSSLMPopUpCarbonMenu3 + 5567
37  com.apple.AppKit                0x00007fff96f50219 _NSPopUpCarbonMenu3 + 39
38  com.apple.AppKit                0x00007fff96f4fff5 -[NSCarbonMenuImpl popUpMenu:atLocation:width:forView:withSelectedItem:withFont:withFlags:withOptions:] + 350
39  com.apple.AppKit                0x00007fff96f4ee94 -[NSPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 559
40  com.apple.AppKit                0x00007fff96f4d139 -[NSControl mouseDown:] + 714
41  com.apple.AppKit                0x00007fff97446f4f -[NSWindow _reallySendEvent:] + 12827
42  com.apple.AppKit                0x00007fff96ed150c -[NSWindow sendEvent:] + 368
43  com.apple.AppKit                0x00007fff96e83096 -[NSApplication sendEvent:] + 2238
44  com.apple.dt.IDEKit             0x00000001089237f4 -[IDEApplication sendEvent:] + 924
45  com.apple.AppKit                0x00007fff96d0fe98 -[NSApplication run] + 711
46  com.apple.AppKit                0x00007fff96cfb2d4 NSApplicationMain + 1832
47  libdyld.dylib                   0x00007fff94f355c9 start + 1

Add support for the standard ANSI escape codes

For my project, I need to have support of standard ANSI escape codes rendering in Xcode (see http://en.wikipedia.org/wiki/ANSI_escape_code). There was a pull request #12 from mkeiser on June 2014 but it wasn't merged.
Is there a reason why not want to make XcodeColors able to understand standard ANSI escape codes?
IMHO there should be no conflict when parsing both current esc[fg...; and standard ANSI simultaneously, isn't it?

Not working with Xcode 6.2

Upgraded my phone to iOS 8.2, which required Xcode 6.2, and it seems like XcodeColors stopped working. Any idea if there's anything I need to do to get it working again?

Has no effect in Xcode 8 GM

With the GM of Xcode 8, the plugin has no effect. The color escape codes are rendered directly in the terminal.

Edit: This is even with the Xcode 8 GM UUID: 8A66E736-A720-4B3C-92F1-33D9962C69DF

xcode13 do not work

xcode13 do not work , but target can build success

2021-12-15 10:13:29.503473+0800 TestXcodeColors[6030:87689] After building the XcodeColors plugin for the first time, you MUST RESTART XCODE.
2021-12-15 10:13:29.503525+0800 TestXcodeColors[6030:87689] If you still don't see colors below, please consult the README.
2021-12-15 10:13:29.503544+0800 TestXcodeColors[6030:87689] �[fg0,0,255;Blue text�[;
2021-12-15 10:13:29.503560+0800 TestXcodeColors[6030:87689] �[bg220,0,0;Red background�[;
2021-12-15 10:13:29.503576+0800 TestXcodeColors[6030:87689] �[fg0,0,255;�[bg220,0,0;Blue text on red background�[;
2021-12-15 10:13:29.503591+0800 TestXcodeColors[6030:87689] �[fg209,57,168;You can supply your own RGB values!�[;
2021-12-15 10:13:29.503605+0800 TestXcodeColors[6030:87689] �[fg0,0,255;Blue text via macro�[;

Crash when viewing bots in Xcode 6

I'm using Xcode 6.0.1 and every time I try to view a bot I've created on an Xcode server I get a crash in the XcodeColors plugin. The stack trace suggests it's in -[XcodeColors_NSTextStorage fixAttributesInRange:] + 35 (XcodeColors.m:285), which is just a call to the original method's implementation.

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000010

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                 0x00007fff8b4e879f objc_retain + 15
1   ru.DeepIT.XcodeColors           0x0000000108a41a43 -[XcodeColors_NSTextStorage fixAttributesInRange:] + 35 (XcodeColors.m:285)
2   com.apple.AppKit                0x00007fff8cb02f49 __NSCreateRenderingContextForAttributedString + 181
3   com.apple.AppKit                0x00007fff8cbc9c7c _NSStringDrawingCore + 2273
4   com.apple.AppKit                0x00007fff8cbc8910 _NSDrawTextCell + 6400
5   com.apple.AppKit                0x00007fff8cbcf5fc -[NSTextFieldCell drawInteriorWithFrame:inView:] + 963
6   com.apple.AppKit                0x00007fff8cbce468 -[NSControl drawRect:] + 341
7   com.apple.AppKit                0x00007fff8cbc104f -[NSView _drawRect:clip:] + 3748
8   com.apple.AppKit                0x00007fff8cbbf8c4 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1799
9   com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
10  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
11  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
12  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
13  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
14  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
15  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
16  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
17  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
18  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
19  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
20  com.apple.dt.DVTKit             0x0000000101c53f1b -[DVTReplacementView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 207
21  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
22  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
23  com.apple.AppKit                0x00007fff8cbbfca0 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2787
24  com.apple.AppKit                0x00007fff8cbbd706 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 841
25  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
26  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
27  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
28  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
29  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
30  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
31  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
32  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
33  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
34  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
35  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
36  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
37  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
38  com.apple.AppKit                0x00007fff8cbbebc4 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 6151
39  com.apple.AppKit                0x00007fff8cbbceb1 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 314
40  com.apple.AppKit                0x00007fff8cbb9e9f -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 2828
41  com.apple.AppKit                0x00007fff8cb992da -[NSView displayIfNeeded] + 1680
42  com.apple.AppKit                0x00007fff8cbfe74e _handleWindowNeedsDisplayOrLayoutOrUpdateConstraints + 884
43  com.apple.AppKit                0x00007fff8d1d4061 __83-[NSWindow _postWindowNeedsDisplayOrLayoutOrUpdateConstraintsUnlessPostingDisabled]_block_invoke1331 + 46
44  com.apple.CoreFoundation        0x00007fff87083d67 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
45  com.apple.CoreFoundation        0x00007fff87083cd7 __CFRunLoopDoObservers + 391
46  com.apple.CoreFoundation        0x00007fff870753b8 __CFRunLoopRun + 776
47  com.apple.CoreFoundation        0x00007fff87074e75 CFRunLoopRunSpecific + 309
48  com.apple.HIToolbox             0x00007fff81e47a0d RunCurrentEventLoopInMode + 226
49  com.apple.HIToolbox             0x00007fff81e47685 ReceiveNextEventCommon + 173
50  com.apple.HIToolbox             0x00007fff81e475bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
51  com.apple.AppKit                0x00007fff8ca6224e _DPSNextEvent + 1434
52  com.apple.AppKit                0x00007fff8ca6189b -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
53  com.apple.dt.DVTKit             0x0000000101d637bd -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 237
54  com.apple.AppKit                0x00007fff8ca5599c -[NSApplication run] + 553
55  com.apple.AppKit                0x00007fff8ca40783 NSApplicationMain + 940
56  libdyld.dylib                   0x00007fff8dd7e5fd start + 1

Is there any way to use colors in lldb?

Log contents in source code will be colorized when using NSLog surrounded with color options, but when debug in lldb with following command:

 po NSLog(@"\xC2\xA0[" @"fg0,0,255;" @"hello" @";")

The text hello won't be colorized, is there any way to colorize the output?

Xcode 7.2.1?

Anyone using Xcode 7.2.1 yet?
I've upgraded Xcode a dozen times and have had no problems getting XcodeColors to work. But this time a couple things are different:

  • In 7.2.1 the DVTPlugInCompatibilityUUID has not been changed from 7.2. Perhaps because it's a minor point release, but UUID is unchanged from 7.2: F41BD31E-2683-44B8-AE7F-5F09E919790E
  • Usually on first load there's a popup informing me about an installed plugin. This did not happen

I'm using the XcodeColors environment variable, so that's not the issue. Thoughts?

Not working in Xcode 7.3

I used XcodeColors for a while and many thx to your contribution~
However, when I get Xcode 7.3 today, it seems that my customer colors disappear... What should I do?

Not working on Xcode 7.3.1

I followed all the README instructions but it doesn't work. XcodeColors.xcplugin shows up in the Plug-ins folder, UUID added, etc, but still not working. Does anyone know why?

When I updated Xcode it also prompted me something about external plugins. Do I need to enable something on Xcode to allow plugins?

Thanks!

Does not work with iOS and Xcode Version 6.1.1 (6A2008a)

I tested the plugin in iOS project and console colors does not work. TestXcodeColors works well.

When I set environment variables programmatically or through edit scheme, colors still does not work.

Plugin is instaled in "~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XcodeColors.xcplugin".

I used NSLog and ESCAPE sequences from TestXcodeColors.

Setting custom colors for DDLogError does not work

I can set custom colors for all log levels in CocoaLumberjack, but it does not work for the error level. The text just remains white on black background

Works:
[[DDTTYLogger sharedInstance] setForegroundColor:UIColor.redColor backgroundColor:UIColor.whiteColor forFlag:DDLogFlagWarning];

No effect:
[[DDTTYLogger sharedInstance] setForegroundColor:UIColor.redColor backgroundColor:UIColor.whiteColor forFlag:DDLogFlagDebug];

When running xcodebuild from terminal other plugins' log statements are not properly escaped

Hey @robbiehanson , I love the plugin!

I'm unsure if this happens with any other kind of log output but when I run xcodebuild and any other plugin logs the coloration is not properly escaped for the terminal causing the log output to be all black and to fold back on itself.

Example unescaped:

[fg242,5,42;�[bg255,255,255;E | gcd:com.apple.main-thread: Current Application is not Xcode | {NSObject+XcodePluginLoad.swift:40:pluginDidLoad}
    �[;2016-03-16 12:52:48.465 xcodebuild[27101:1260091] +[MCLog load], env: YES
    2016-03-16 12:52:48.466 xcodebuild[27101:1260091] [MCLog] +[MCLog pluginDidLoad:](Line:43) +[MCLog pluginDidLoad:], NSBundle </Users/ian/Library/Application Support/Developer/Shared/Xcode/Plug-ins/MCLog.xcplugin> (loaded)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.