Skip to content

Instantly share code, notes, and snippets.

@STAR-ZERO
Last active December 14, 2015 03:09
Show Gist options
  • Select an option

  • Save STAR-ZERO/5018796 to your computer and use it in GitHub Desktop.

Select an option

Save STAR-ZERO/5018796 to your computer and use it in GitHub Desktop.
XcodeColorsでXcodeのログに色をつける

XcodeColorsでXcodeのログに色をつける

https://github.com/robbiehanson/XcodeColors

インストール

GitHubからソース取得

$ git clone git://github.com/robbiehanson/XcodeColors.git

Xcodeで開いてリリースビルド

Xcode開いてメニューからProductArchiveを選択

~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XcodeColors.xcpluginが出来ていればOK

Xcodeを一旦閉じる

使い方

.pchファイルに追加

#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

色付きのログを出力

NSLog(XCODE_COLORS_ESCAPE @"fg0,0,255;" @"Blue text" XCODE_COLORS_RESET);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment