Class: Push::Daemon::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/push/daemon/logger.rb

Instance Method Summary collapse

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)
  @options = 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, options = {})
  error_notification(msg, options)
  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