Project

clog

0.0
No commit activity in last 3 years
No release in over 3 years
Little rails debugging gem for writing colorized output to log file.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

clog (“color log”)¶ ↑

Little Ruby On Rails debugging gem for writing colorized output to log file.

Because clog is all about color

here’s a blog posting with color pictures

Usage¶ ↑

> gem install clog

Rails 3x, in Gemfile

gem "clog"

No argument outputs a “flag”¶ ↑

clog

Single argument¶ ↑

clog var

Tagged argument¶ ↑

First argument must be a symbol, which it outputs before second argument.

clog :var, var

{:one=>1, :two=>2, :three=>3}.each do |k,v|
  clog k, v
end

Multiple arguments¶ ↑

Will output each on its own line.

clog Object.new, Kernel, RUBY_VERSION, :a_symbol

Changing color¶ ↑

Put something like this in a rails config file someplace

Clog.colors(background, forground=white)

Choices- :black, :red, :green, :yellow, :blue, :magenta, :cyan, :white

Clog.colors(:blue)
Clog.colors(:black, yellow)

Default is red background, white foreground.

Max width¶ ↑

clog figures out when its appropriate to place additional information (line number, calling method, etc) on the right of the output or below it on the next line. Think of maxwidth as representing the width of your terminal window. The default is 150

Clog.maxwidth(100)

Changes¶ ↑

version 0.2.0 now outputs during testing (not to log but to shell)

version 0.2.1 does the opposite of the above line. Tests now have too much formatting and output, so lets log to test.log if we’re running in a rails env

Copyright © 2010 Kevin Swope. See LICENSE for details.