Class: Push::Daemon::Logger
- Inherits:
-
Object
- Object
- Push::Daemon::Logger
- Defined in:
- lib/push/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 10 11 12 |
# File 'lib/push/daemon/logger.rb', line 4 def initialize() @options = if @options[:foreground] STDOUT.sync = true else open_log end end |
Instance Method Details
#error(msg, options = {}) ⇒ Object
18 19 20 21 |
# File 'lib/push/daemon/logger.rb', line 18 def error(msg, = {}) error_notification(msg, ) log(:error, msg, 'ERROR') end |
#info(msg) ⇒ Object
14 15 16 |
# File 'lib/push/daemon/logger.rb', line 14 def info(msg) log(:info, msg) end |
#warn(msg) ⇒ Object
23 24 25 |
# File 'lib/push/daemon/logger.rb', line 23 def warn(msg) log(:warn, msg, 'WARNING') end |