#!/usr/bin/env ruby # coding: utf-8 # # Logentries Ruby monitoring agent # Copyright 2010,2011 Logentries, Jlizard # Mark Lacomber # require 'socket' require 'openssl' 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 @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 @deliverer.deliver(message) end end def close nil end end end end