Module: Amp::Support::SingletonLogger

Included in:
Logger
Defined in:
lib/amp/support/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/amp/support/logger.rb', line 17

def method_missing(meth, *args, &block)
  if global_logger.respond_to?(meth)
    global_logger.__send__(meth, *args, &block)
  else
    super
  end
end

Instance Attribute Details

#singleton_objectObject

Returns the value of attribute singleton_object.



6
7
8
# File 'lib/amp/support/logger.rb', line 6

def singleton_object
  @singleton_object
end

Instance Method Details

#debug(*args) ⇒ Object



15
# File 'lib/amp/support/logger.rb', line 15

def debug(*args); global_logger.debug(*args); end

#error(*args) ⇒ Object



14
# File 'lib/amp/support/logger.rb', line 14

def error(*args); global_logger.error(*args); end

#fatal(*args) ⇒ Object



13
# File 'lib/amp/support/logger.rb', line 13

def fatal(*args); global_logger.fatal(*args); end

#global_loggerObject



7
8
9
# File 'lib/amp/support/logger.rb', line 7

def global_logger
  singleton_object
end

#info(*args) ⇒ Object



12
# File 'lib/amp/support/logger.rb', line 12

def info(*args);  global_logger.info(*args);  end

#warn(*args) ⇒ Object



11
# File 'lib/amp/support/logger.rb', line 11

def warn(*args);  global_logger.warn(*args);  end