Module: DataModel::Logging
- Included in:
- Builtin::Hash, Builtin::Or, Scanner
- Defined in:
- lib/data_model/logging.rb
Overview
Provides a logger for classes that include it
Instance Method Summary collapse
-
#log ⇒ Logger
Get a logger.
Instance Method Details
#log ⇒ Logger
Get a logger
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/data_model/logging.rb', line 8 def log target = respond_to?(:name) ? self : self.class logger = Logger.new( STDERR, level: Logger::FATAL, progname: target.name, ) return @log ||= logger end |