Sha256: 0595cbf77316480d7f4cfbd613c6db39e9cac68e2c576bba352bcf76266f7b12

Contents?: true

Size: 721 Bytes

Versions: 1

Compression:

Stored size: 721 Bytes

Contents

require File.join(File.dirname(__FILE__), 'le', 'host')

require 'logger'

module Le

 def self.new(key, location, local=false)

   self.checkParams(key, location)

   host = Le::Host.new(key, location, local)      
   logger = Logger.new(host)
   
   if host.respond_to?(:formatter)
	logger.formatter = host.formatter
   end

   logger  
 end

 def self.checkParams(key, location)
    if key == nil or location == nil
       puts "\nLE: Incorrect parameters for Logentries Plugin!\n"
    end
 
    # Check if the key is valid UUID format
    if (key =~ /\A(urn:uuid:)?[\da-f]{8}-([\da-f]{4}-){3}[\da-f]{12}\z/i) == nil
       puts "\nLE: It appears the LOGENTRIES_ACCOUNT_KEY you entered is invalid!\n"
    end
 end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
le-1.9 ./lib/le.rb