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

Instance Method Details

#logLogger

Get a logger

Returns:

  • (Logger)

    the logger for this class



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