Sha256: 906a35cc8e3d4e9b9db37b4113d93f520c31f2d694c3aaf449fc2ef05b1dfb3a

Contents?: true

Size: 819 Bytes

Versions: 1

Compression:

Stored size: 819 Bytes

Contents

#!/usr/bin/env ruby
# coding: utf-8

#
# Logentries Ruby monitoring agent
# Copyright 2010,2011 Logentries, Jlizard
# 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, :local_bool

      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)

		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
    
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
le-1.8 ./lib/le/host/https.rb