Class: Rapns::Daemon::Logger
- Inherits:
-
Object
- Object
- Rapns::Daemon::Logger
- Defined in:
- lib/rapns/daemon/logger.rb
Instance Method Summary collapse
- #error(msg, options = {}) ⇒ Object
- #info(msg) ⇒ Object
-
#initialize(options) ⇒ Logger
constructor
A new instance of Logger.
- #warn(msg) ⇒ Object
Constructor Details
#initialize(options) ⇒ Logger
Returns a new instance of Logger.
4 5 6 7 8 9 |
# File 'lib/rapns/daemon/logger.rb', line 4 def initialize() = log_path = File.join(Rails.root, 'log', 'rapns.log') @logger = ActiveSupport::BufferedLogger.new(log_path, Rails.logger.level) @logger.auto_flushing = Rails.logger.respond_to?(:auto_flushing) ? Rails.logger.auto_flushing : true end |
Instance Method Details
#error(msg, options = {}) ⇒ Object
15 16 17 18 |
# File 'lib/rapns/daemon/logger.rb', line 15 def error(msg, = {}) airbrake_notify(msg) if notify_via_airbrake?(msg, ) log(:error, msg, 'ERROR') end |
#info(msg) ⇒ Object
11 12 13 |
# File 'lib/rapns/daemon/logger.rb', line 11 def info(msg) log(:info, msg) end |
#warn(msg) ⇒ Object
20 21 22 |
# File 'lib/rapns/daemon/logger.rb', line 20 def warn(msg) log(:warn, msg, 'WARNING') end |