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.
43 44 45 |
# File 'lib/checkoff/internal/logging.rb', line 43 def debug( = nil, &block) logger.debug(, &block) end |
#error(message = nil, &block) ⇒ void
This method returns an undefined value.
22 23 24 |
# File 'lib/checkoff/internal/logging.rb', line 22 def error( = nil, &block) logger.error(, &block) end |
#finer(message = nil, &block) ⇒ void
This method returns an undefined value.
50 51 52 53 54 |
# File 'lib/checkoff/internal/logging.rb', line 50 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.
36 37 38 |
# File 'lib/checkoff/internal/logging.rb', line 36 def info( = nil, &block) logger.info(, &block) end |
#logger ⇒ ::Logger
9 10 11 12 13 14 15 16 17 |
# File 'lib/checkoff/internal/logging.rb', line 9 def logger # @sg-ignore @logger ||= if defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger # @sg-ignore Rails.logger else ::Logger.new($stdout, level: log_level) end end |
#warn(message = nil, &block) ⇒ void
This method returns an undefined value.
29 30 31 |
# File 'lib/checkoff/internal/logging.rb', line 29 def warn( = nil, &block) logger.warn(, &block) end |