./lib/le/host/http.rb in le-2.1.3 vs ./lib/le/host/http.rb in le-2.1.4

- old
+ new

@@ -8,20 +8,24 @@ class HTTP include Le::Host::InstanceMethods attr_accessor :token, :queue, :started, :thread, :conn, :local def initialize(token, local) + if defined?(Rails) + @logger_console = Logger.new("log/#{Rails.env}.log") + else + @logger_console = Logger.new(STDOUT); + end @token = token @local = local @queue = Queue.new @started = false @thread = nil end def write(message) if @local then - puts message - return + @logger_console.add(Logger::Severity::UNKNOWN,message) end @queue << "#{@token}#{message}\n" if @started then