僕は発展途上技術者

color-log: Colorizes the output of the standard library debug logger.

Note: I asked Tokyo iOS Meetup organizer and my nice English sensei Matt-san(@gillygize) for review and he made some suggestions. Thank you so much.

Suppose I want to output some a debug message on in Rails log.

I do like I can do it like this:

class WelcomeController < ApplicationController
def index
logger.debug "Test"
end
end


, but it is always hard to find that debug message in the log messages.

To make it easy easier to find it, I always do like this.:

logger.debug "*" * 80
logger.debug "Test"


I know it is a dirty solution and it is super MENDOKUSAI("bothering" "bothersome" in Japanese), so I created a tiny gem that it colorizes the output of logger.debug as below:



To install it, just add the following line in your Gemfile and do "bundle install". That's it!

gem 'color-log', git: 'https://gist.github.com/champierre/692b739c4fe875820f7e', group: :development


I personally like this simple gem, and also like that I can publish a gem from Gists. It is very handy.

The source code is available at https://gist.github.com/champierre/692b739c4fe875820f7e.

プロフィール

株式会社まちクエスト代表、つくる社LLC代表。

Scratchで楽しく学ぶ アート&サイエンスRaspberry Piではじめる どきどきプログラミングを書きました。

オンラインコンテンツ: 大人のためのScratch

Amazonから図書館検索 Libron、iPhoneアプリ ひらがなゲーム かなぶん を作っています。

Email: webmaster at champierre dot com

Twitter @jishiha

最近のエントリー

アーカイブ