Module: Kanina::Logger
- Included in:
- Server, Subscription
- Defined in:
- lib/kanina/logger.rb
Overview
Kanina::Logger
simplifies sending messages to standard output and/or the
Rails log files.
Constant Summary collapse
- DEFAULT_LOG_LEVEL =
::Logger::INFO
Instance Method Summary collapse
-
#logger ⇒ Rails::Logger
Sets up the Rails logger.
-
#say(text, level = DEFAULT_LOG_LEVEL) ⇒ Object
Sends a message to the log.
Instance Method Details
#logger ⇒ Rails::Logger
Sets up the Rails logger
11 12 13 14 |
# File 'lib/kanina/logger.rb', line 11 def logger Rails.logger ||= ::Logger.new(STDOUT) @logger ||= Rails.logger end |
#say(text, level = DEFAULT_LOG_LEVEL) ⇒ Object
Sends a message to the log
19 20 21 22 |
# File 'lib/kanina/logger.rb', line 19 def say(text, level = DEFAULT_LOG_LEVEL) puts text if @loud logger.add level, "HARE: #{text}" end |