lib/pushyd/endpoint.rb in pushyd-0.5.0 vs lib/pushyd/endpoint.rb in pushyd-0.5.1
- old
+ new
@@ -9,11 +9,11 @@
class Endpoint
def initialize
# Prepare logger
- init_logger Conf[:log]
+ init_logger Conf[:logs]
# Done
info "endpoint initialized"
# loop do
# info "info"
@@ -25,10 +25,14 @@
end
protected
def init_logger logconf
+ # Check structure conformity or set it to an empty hash
+ logconf = {} unless logconf.is_a? Hash
+
# Extract context
+ logconf ||= {}
logfile = logconf[:file]
loglevel = logconf[:level]
me = self.class.name
# Prepare logger (may be NIL > won't output anything)