class SimpleLogger
Copyright 2008-2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Attributes
level[RW]
Public Class Methods
new()
click to toggle source
# File lib/simple_logger.rb, line 7 def initialize @level = :info end
Public Instance Methods
error(msg)
click to toggle source
# File lib/simple_logger.rb, line 27 def error(msg) if [:debug, :trace, :info, :error].include?(level) then STDOUT.puts "#{Time.now.utc} ERROR " + msg end end
fatal(msg)
click to toggle source
# File lib/simple_logger.rb, line 33 def fatal(msg) if [:debug, :trace, :info, :error, :fatal].include?(level) then STDOUT.puts "#{Time.now.utc} FATAL " + msg end end
info(msg)
click to toggle source
# File lib/simple_logger.rb, line 21 def info(msg) if [:debug, :trace, :info].include?(level) then STDOUT.puts "#{Time.now.utc} INFO " + msg end end
puts(msg)
click to toggle source
# File lib/simple_logger.rb, line 11 def puts(msg) STDOUT.puts msg end
trace(msg)
click to toggle source
# File lib/simple_logger.rb, line 15 def trace(msg) if [:debug, :trace].include?(level) then STDOUT.puts "#{Time.now.utc} TRACE " + msg end end