Class: LoggerFacade::Log

Inherits:
Object
  • Object
show all
Defined in:
lib/logger_facade/log.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, plugins) ⇒ Log

Returns a new instance of Log.



7
8
9
10
# File 'lib/logger_facade/log.rb', line 7

def initialize(name, plugins)
  @name = name
  @plugins = plugins
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/logger_facade/log.rb', line 5

def name
  @name
end

#pluginsObject (readonly)

Returns the value of attribute plugins.



5
6
7
# File 'lib/logger_facade/log.rb', line 5

def plugins
  @plugins
end

Instance Method Details

#debug(message, metadata = {}) ⇒ Object



20
21
22
# File 'lib/logger_facade/log.rb', line 20

def debug(message,  = {})
  log(:debug, message, )
end

#error(message, metadata = {}) ⇒ Object



32
33
34
# File 'lib/logger_facade/log.rb', line 32

def error(message,  = {})
  log(:error, message, )
end

#info(message, metadata = {}) ⇒ Object



24
25
26
# File 'lib/logger_facade/log.rb', line 24

def info(message,  = {})
  log(:info, message, )
end

#is_debugObject



12
13
14
# File 'lib/logger_facade/log.rb', line 12

def is_debug
  plugins.select { |p| p.is_debug }.size > 0
end

#trace(message, metadata = {}) ⇒ Object



16
17
18
# File 'lib/logger_facade/log.rb', line 16

def trace(message,  = {})
  log(:trace, message, )
end

#warn(message, metadata = {}) ⇒ Object



28
29
30
# File 'lib/logger_facade/log.rb', line 28

def warn(message,  = {})
  log(:warn, message, )
end