class Ezframe::EzLog
Public Class Methods
<<(msg)
click to toggle source
# File lib/ezframe/ezlog.rb, line 35 def <<(msg) writer("", msg) end
debug(msg)
click to toggle source
# File lib/ezframe/ezlog.rb, line 23 def debug(msg) writer("debug", msg) end
error(msg)
click to toggle source
# File lib/ezframe/ezlog.rb, line 31 def error(msg) writer("debug", msg) end
info(msg)
click to toggle source
# File lib/ezframe/ezlog.rb, line 19 def info(msg) writer("info", msg) end
level=(lv)
click to toggle source
# File lib/ezframe/ezlog.rb, line 15 def level=(lv) @level = lv end
warn(msg)
click to toggle source
# File lib/ezframe/ezlog.rb, line 27 def warn(msg) writer("warn", msg) end
writer(level="", msg)
click to toggle source
# File lib/ezframe/ezlog.rb, line 6 def writer(level="", msg) # unless @instance # @instance = File.open("log/#{ENV['RACK_ENV']||'development'}.log", "a+") # @instance.sync = true # end # @instance.puts "#{Time.now.to_s}:#{level.upcase}:#{msg}" File.open("log/#{ENV['RACK_ENV']||'development'}.log", "a+") {|f| f.puts "#{Time.now.to_s}:#{level.upcase}:#{msg}"} end