Class: LoggingFactory::Logger
- Inherits:
-
Object
- Object
- LoggingFactory::Logger
- Includes:
- Preconditions
- Defined in:
- lib/logging_factory.rb
Overview
Main logger class
Instance Attribute Summary collapse
-
#log_configuration ⇒ Object
readonly
Returns the value of attribute log_configuration.
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Logger
constructor
Initializes this logger instance with teh format specified.
-
#log(caller, config = {}) ⇒ Object
Returns a new log for the calling class with the supplied configuration.
Methods included from Preconditions
Constructor Details
#initialize(config = {}) ⇒ Logger
Initializes this logger instance with teh format specified
39 40 41 |
# File 'lib/logging_factory.rb', line 39 def initialize(config = {}) @log_configuration = DEFAULT_LOG_CONFIGURATION.merge(config) end |
Instance Attribute Details
#log_configuration ⇒ Object (readonly)
Returns the value of attribute log_configuration.
36 37 38 |
# File 'lib/logging_factory.rb', line 36 def log_configuration @log_configuration end |
Instance Method Details
#log(caller, config = {}) ⇒ Object
Returns a new log for the calling class with the supplied configuration
44 45 46 47 48 49 |
# File 'lib/logging_factory.rb', line 44 def log(caller, config = {}) log_configuration = @log_configuration.merge(config) log = Logging.logger[caller] add_appenders(log, log_configuration) log end |