Class: LoggerLogger
- Inherits:
-
Object
- Object
- LoggerLogger
- Defined in:
- lib/debugtrace/loggers.rb
Overview
A logger class that outputs using the logging library.
Defined Under Namespace
Classes: Formatter
Instance Method Summary collapse
-
#initialize(config) ⇒ LoggerLogger
constructor
A new instance of LoggerLogger.
-
#print(message) ⇒ Object
Outputs the message.
-
#to_s ⇒ Object
Returns a string representation of this object.
Constructor Details
#initialize(config) ⇒ LoggerLogger
Returns a new instance of LoggerLogger.
80 81 82 83 84 85 86 |
# File 'lib/debugtrace/loggers.rb', line 80 def initialize(config) @config = Common::check_type("config", config, Config) @logger = Logger.new( @config.logging_destination, formatter: Formatter.new(@config), datetime_format: @config.logging_datetime_format) end |
Instance Method Details
#print(message) ⇒ Object
Outputs the message.
90 91 92 93 |
# File 'lib/debugtrace/loggers.rb', line 90 def print() Common::check_type("message", , String) @logger.log(Logger::Severity::DEBUG, , 'DebugTrace-rb') end |
#to_s ⇒ Object
Returns a string representation of this object.
97 98 99 |
# File 'lib/debugtrace/loggers.rb', line 97 def to_s 'logging.Logger logger' end |