Module: Amigrind::Core::Logging::Mixin

Defined in:
lib/amigrind/core/logging.rb

Overview

Helper methods to be mixed into classes that must perform logging. (So, most of them.)

Instance Method Summary collapse

Instance Method Details

#debug_log(msg) ⇒ Object

Records a log with debug priority.

Parameters:

  • msg (String)

    the message to record to the logger



48
49
50
# File 'lib/amigrind/core/logging.rb', line 48

def debug_log(msg)
  Amigrind::Core::Logging.logger.debug msg
end

#error_log(msg) ⇒ Object

Records a log with error priority.

Parameters:

  • msg (String)

    the message to record to the logger



66
67
68
# File 'lib/amigrind/core/logging.rb', line 66

def error_log(msg)
  Amigrind::Core::Logging.logger.error msg
end

#info_log(msg) ⇒ Object

Records a log with info priority.

Parameters:

  • msg (String)

    the message to record to theimpo logger



54
55
56
# File 'lib/amigrind/core/logging.rb', line 54

def info_log(msg)
  Amigrind::Core::Logging.logger.info msg
end

#loggerObject

Returns the logger used by Amigrind::Core::Logging.



42
43
44
# File 'lib/amigrind/core/logging.rb', line 42

def logger
  Amigrind::Core::Logging.logger
end

#warn_log(msg) ⇒ Object

Records a log with warn priority.

Parameters:

  • msg (String)

    the message to record to the logger



60
61
62
# File 'lib/amigrind/core/logging.rb', line 60

def warn_log(msg)
  Amigrind::Core::Logging.logger.warn msg
end