./lib/le.rb in le-1.9 vs ./lib/le.rb in le-1.9.1
- old
+ new
@@ -1,5 +1,14 @@
+#!/usr/bin/env ruby
+# coding: utf-8
+
+#
+# Logentries Ruby monitoring agent
+# Copyright 2010,2011 Logentries, Jlizard
+# Mark Lacomber <marklacomber@gmail.com>
+#
+
require File.join(File.dirname(__FILE__), 'le', 'host')
require 'logger'
module Le
@@ -9,23 +18,21 @@
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.formatter = host.formatter
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
+ 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