Class: RubyLogger
- Inherits:
-
LoggerBase
- Object
- LoggerBase
- RubyLogger
- Defined in:
- lib/debugtrace/loggers.rb
Overview
A logger class that outputs using Ruby Logger.
Defined Under Namespace
Classes: Formatter
Instance Method Summary collapse
-
#initialize(config) ⇒ RubyLogger
constructor
Initializes this object.
-
#print(message) ⇒ Object
Outputs the message.
-
#to_s ⇒ String
Returns a string representation of this object.
Constructor Details
#initialize(config) ⇒ RubyLogger
Initializes this object.
84 85 86 87 88 89 90 |
# File 'lib/debugtrace/loggers.rb', line 84 def initialize(config) @config = Common::check_type("config", config, Config) @logger = Logger.new( @config.log_path, formatter: Formatter.new(@config), datetime_format: @config.log_datetime_format) end |
Instance Method Details
#print(message) ⇒ Object
Outputs the message.
95 96 97 98 99 |
# File 'lib/debugtrace/loggers.rb', line 95 def print() Common::check_type("message", , String) @logger.log(Logger::Severity::DEBUG, , 'DebugTrace') return end |
#to_s ⇒ String
Returns a string representation of this object.
104 105 106 |
# File 'lib/debugtrace/loggers.rb', line 104 def to_s return "Ruby #{Logger.name} path: #{@config.log_path}" end |