lib/logi/logger.rb in logi-0.1.0 vs lib/logi/logger.rb in logi-0.1.1
- old
+ new
@@ -2,11 +2,11 @@
class Logi; end
module Logi::Logger
module_function
def log msg
return if options[:quiet]
- puts msg
+ $stderr.puts msg
end
def black text; color(30, text); end
def red text; color(31, text); end
def green text; color(32, text); end
@@ -16,10 +16,10 @@
def cyan text; color(36, text); end
def white text; color(37, text); end
def color rgb, text
if nocolor = options[:nocolor]
text
- elsif nocolor.nil? && !$stdout.tty? # auto-detect
+ elsif nocolor.nil? && !$stderr.tty? # auto-detect
text
else
"\e[#{rgb}m#{text}\e[0m"
end
end