Class: LoggerFacade::Log
- Inherits:
-
Object
- Object
- LoggerFacade::Log
- Defined in:
- lib/logger_facade/log.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#plugins ⇒ Object
readonly
Returns the value of attribute plugins.
Instance Method Summary collapse
- #debug(message, metadata = {}) ⇒ Object
- #error(message, metadata = {}) ⇒ Object
- #info(message, metadata = {}) ⇒ Object
-
#initialize(name, plugins) ⇒ Log
constructor
A new instance of Log.
- #is_debug ⇒ Object
- #trace(message, metadata = {}) ⇒ Object
- #warn(message, metadata = {}) ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/logger_facade/log.rb', line 5 def name @name end |
#plugins ⇒ Object (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(, = {}) log(:debug, , ) end |
#error(message, metadata = {}) ⇒ Object
32 33 34 |
# File 'lib/logger_facade/log.rb', line 32 def error(, = {}) log(:error, , ) end |
#info(message, metadata = {}) ⇒ Object
24 25 26 |
# File 'lib/logger_facade/log.rb', line 24 def info(, = {}) log(:info, , ) end |
#is_debug ⇒ Object
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(, = {}) log(:trace, , ) end |
#warn(message, metadata = {}) ⇒ Object
28 29 30 |
# File 'lib/logger_facade/log.rb', line 28 def warn(, = {}) log(:warn, , ) end |