Module: Logging
- Included in:
- Checkoff::Attachments, Checkoff::Events, Checkoff::Internal::AsanaEventEnrichment, Checkoff::Internal::AsanaEventFilter, Checkoff::Projects, Checkoff::Sections, Checkoff::SelectorClasses::FunctionEvaluator, Checkoff::TaskSearches, Checkoff::Tasks, Checkoff::Timing
- Defined in:
- lib/checkoff/internal/logging.rb
Overview
include this to add ability to log at different levels
Instance Method Summary collapse
- #debug(message = nil, &block) ⇒ void
- #error(message = nil, &block) ⇒ void
- #finer(message = nil, &block) ⇒ void
- #info(message = nil, &block) ⇒ void
- #logger ⇒ ::Logger
- #warn(message = nil, &block) ⇒ void
Instance Method Details
#debug(message = nil, &block) ⇒ void
This method returns an undefined value.
44 45 46 |
# File 'lib/checkoff/internal/logging.rb', line 44 def debug( = nil, &block) logger.debug(, &block) end |
#error(message = nil, &block) ⇒ void
This method returns an undefined value.
23 24 25 |
# File 'lib/checkoff/internal/logging.rb', line 23 def error( = nil, &block) logger.error(, &block) end |
#finer(message = nil, &block) ⇒ void
This method returns an undefined value.
51 52 53 54 55 |
# File 'lib/checkoff/internal/logging.rb', line 51 def finer( = nil, &block) # No such level by default # # logger.finer(message, &block) end |
#info(message = nil, &block) ⇒ void
This method returns an undefined value.
37 38 39 |
# File 'lib/checkoff/internal/logging.rb', line 37 def info( = nil, &block) logger.info(, &block) end |
#logger ⇒ ::Logger
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/checkoff/internal/logging.rb', line 9 def logger # @type [::Logger] @logger ||= if Object.const_defined?(:Rails) rails = Object.const_get(:Rails) rails_logger = rails.respond_to?(:logger) ? rails.logger : nil rails_logger || ::Logger.new($stdout, level: log_level) else ::Logger.new($stdout, level: log_level) end end |
#warn(message = nil, &block) ⇒ void
This method returns an undefined value.
30 31 32 |
# File 'lib/checkoff/internal/logging.rb', line 30 def warn( = nil, &block) logger.warn(, &block) end |