Class: Fabric::FabricLogger
- Inherits:
-
Object
- Object
- Fabric::FabricLogger
- Defined in:
- lib/fabric/fabric_logger.rb
Constant Summary collapse
- LOGGER_TAG =
'HYPERLEDGER FABRIC'.freeze
- FILTERED_MASK =
'[FILTERED]'.freeze
Instance Attribute Summary collapse
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #debug(*args) ⇒ Object
- #error(*args) ⇒ Object
- #info(*args) ⇒ Object
-
#initialize(logger, filters = []) ⇒ FabricLogger
constructor
A new instance of FabricLogger.
Constructor Details
#initialize(logger, filters = []) ⇒ FabricLogger
Returns a new instance of FabricLogger.
8 9 10 11 |
# File 'lib/fabric/fabric_logger.rb', line 8 def initialize(logger, filters = []) @logger = logger @filters = [filters].compact end |
Instance Attribute Details
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
6 7 8 |
# File 'lib/fabric/fabric_logger.rb', line 6 def filters @filters end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
6 7 8 |
# File 'lib/fabric/fabric_logger.rb', line 6 def logger @logger end |
Instance Method Details
#debug(*args) ⇒ Object
25 26 27 28 29 |
# File 'lib/fabric/fabric_logger.rb', line 25 def debug(*args) return unless logger logger.debug (args.join('|')) end |
#error(*args) ⇒ Object
13 14 15 16 17 |
# File 'lib/fabric/fabric_logger.rb', line 13 def error(*args) return unless logger logger.error (args.join('|')) end |
#info(*args) ⇒ Object
19 20 21 22 23 |
# File 'lib/fabric/fabric_logger.rb', line 19 def info(*args) return unless logger logger.info (args.join('|')) end |