Sha256: 735ed0e8589a164179fecead606de6b5a4a5ffff901f935890036ade0e27fc4c
Contents?: true
Size: 705 Bytes
Versions: 14
Compression:
Stored size: 705 Bytes
Contents
module Eco module Language # Some modules/classes use logger, but they may not be connected to session. # This prevents errors with this. module AuxiliarLogger attr_writer :logger # Provides either an available logger or a basic one def logger if defined?(super) super elsif respond_to?(:session) session.logger elsif instance_variable_defined?(:@session) @session.logger else @logger ||= Eco::Language::BasicLogger.new end end # Shortcut to logger. def log(level, &block) logger.send(level, &block) if logger end end end end
Version data entries
14 entries across 14 versions & 1 rubygems