lib/mini_graphite/logger.rb in mini_graphite-0.0.3 vs lib/mini_graphite/logger.rb in mini_graphite-0.0.5

- old
+ new

@@ -1,28 +1,28 @@ module Dalia - module MiniGraphite + module MiniGraphite - class Logger - attr_reader :debug_mode + class Logger + attr_reader :debug_mode - def initialize(debug_mode = true) - @debug_mode = debug_mode - end + def initialize(debug_mode = true) + @debug_mode = debug_mode + end - def debug(message) - return unless debug_mode + def debug(message) + return unless debug_mode - result = "Dalia::MiniGraphite [#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}]: #{message}" + result = "Dalia::MiniGraphite [#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}]: #{message}" - if defined? ::Rails - ::Rails.logger.info result - else - Kernel.puts result - end - end + if defined? ::Rails + ::Rails.logger.info result + else + Kernel.puts result + end + end - end + end - end + end end