Module: IronNails::Logging::ClassLogger

Instance Method Summary collapse

Instance Method Details

#log_on_errorObject

Ensures that a message is logged when the execution of the specified block throws an error. It will then re-raise the error.



16
17
18
19
20
21
22
23
# File 'lib/ironnails/logging/class_logger.rb', line 16

def log_on_error
  begin
    yield if block_given?
  rescue Exception => e
    logger.error "IronNails Error: #{e}"
    raise e
  end
end

#loggerObject

provides access for the logger we are using you can override this logger as long as it responds to the methods: debug, info, warn, error, fatal



10
11
12
# File 'lib/ironnails/logging/class_logger.rb', line 10

def logger
  IRONNAILS_DEFAULT_LOGGER
end