Class: VanagonLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/vanagon/logger.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output = $stdout) ⇒ VanagonLogger

Returns a new instance of VanagonLogger.



24
25
26
27
28
29
30
# File 'lib/vanagon/logger.rb', line 24

def initialize(output = $stdout)
  super(output)
  self.level = ::Logger::INFO
  self.formatter = proc do |severity, datetime, progname, msg|
    "#{msg}\n"
  end
end

Class Method Details

.debug_loggerObject



8
9
10
# File 'lib/vanagon/logger.rb', line 8

def self.debug_logger
  @@debug_logger ||= VanagonLogger.new($stderr)
end

.error(msg) ⇒ Object



20
21
22
# File 'lib/vanagon/logger.rb', line 20

def self.error(msg)
  VanagonLogger.logger.error msg
end

.info(msg) ⇒ Object



12
13
14
# File 'lib/vanagon/logger.rb', line 12

def self.info(msg)
  VanagonLogger.debug_logger.info msg
end

.loggerObject



4
5
6
# File 'lib/vanagon/logger.rb', line 4

def self.logger
  @@logger ||= VanagonLogger.new
end

.warn(msg) ⇒ Object



16
17
18
# File 'lib/vanagon/logger.rb', line 16

def self.warn(msg)
  VanagonLogger.logger.warn msg
end