./lib/le/host/https.rb in le-1.6 vs ./lib/le/host/https.rb in le-1.8

- old
+ new

@@ -7,31 +7,35 @@ # Mark Lacomber <marklacomber@gmail.com> # require 'socket' require 'openssl' +require 'logger' require File.join(File.dirname(__FILE__), 'https', 'tcp') module Le module Host class HTTPS include Le::Host::HelperMethods - attr_reader :deliverer + attr_reader :deliverer, :local_bool - def initialize(key, location) - - @deliverer = Le::Host::HTTPS::TCPSOCKET.new(key, location) - + def initialize(key, location, local) + @local_bool = local + if not @local_bool + @deliverer = Le::Host::HTTPS::TCPSOCKET.new(key, location) + end end def write(message) - # In the Heroku environment, this puts command will write the message to standard Heroku logs also - puts message - # Deliver the message to logentries via TCP - @deliverer.deliver(message) + if @local_bool + puts message + else + # Deliver the message to logentries via TCP if not testing locally + @deliverer.deliver(message) + end end def close nil end