Module: Kameleoon::Logging::KameleoonLogger
- Extended by:
- KameleoonLogger
- Included in:
- KameleoonLogger
- Defined in:
- lib/kameleoon/logging/kameleoon_logger.rb
Instance Attribute Summary collapse
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #debug(data, *args) ⇒ Object
- #error(data, *args) ⇒ Object
- #info(data, *args) ⇒ Object
- #log(level, data, *args) ⇒ Object
- #warning(data, *args) ⇒ Object
Instance Attribute Details
#log_level ⇒ Object
Returns the value of attribute log_level.
36 37 38 |
# File 'lib/kameleoon/logging/kameleoon_logger.rb', line 36 def log_level @log_level end |
#logger ⇒ Object
Returns the value of attribute logger.
36 37 38 |
# File 'lib/kameleoon/logging/kameleoon_logger.rb', line 36 def logger @logger end |
Instance Method Details
#debug(data, *args) ⇒ Object
62 63 64 |
# File 'lib/kameleoon/logging/kameleoon_logger.rb', line 62 def debug(data, *args) log(LogLevel::DEBUG, data, *args) end |
#error(data, *args) ⇒ Object
54 55 56 |
# File 'lib/kameleoon/logging/kameleoon_logger.rb', line 54 def error(data, *args) log(LogLevel::ERROR, data, *args) end |
#info(data, *args) ⇒ Object
50 51 52 |
# File 'lib/kameleoon/logging/kameleoon_logger.rb', line 50 def info(data, *args) log(LogLevel::INFO, data, *args) end |
#log(level, data, *args) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/kameleoon/logging/kameleoon_logger.rb', line 38 def log(level, data, *args) return unless check_level(level) if data.class.method_defined?(:call) = data.call else = args.empty? ? data : data % args end (level, ) end |