Class: StdLogger
- Inherits:
-
LoggerBase
- Object
- LoggerBase
- StdLogger
- Defined in:
- lib/debugtrace/loggers.rb
Overview
Abstract base class for StdOut and StdErr classes.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(config, iostream) ⇒ StdLogger
constructor
Initializes this object.
-
#print(message) ⇒ Object
Outputs the message.
Constructor Details
#initialize(config, iostream) ⇒ StdLogger
Initializes this object.
20 21 22 23 |
# File 'lib/debugtrace/loggers.rb', line 20 def initialize(config, iostream) @config = Common::check_type("config", config, Config) @iostream = iostream end |
Instance Method Details
#print(message) ⇒ Object
Outputs the message.
27 28 29 30 31 |
# File 'lib/debugtrace/loggers.rb', line 27 def print() Common::check_type("message", , String) datetime_str = Time.now().strftime(@config.logging_datetime_format) @iostream.puts "#{datetime_str} #{}" end |