Sha256: e2516b80a74e4278c50c0e3bda3dfcf37e0893d68d0de7fd7ba569e0ad90bd82
Contents?: true
Size: 793 Bytes
Versions: 22
Compression:
Stored size: 793 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 instance_variable_defined?(:@session) && !@session.nil? @session.logger elsif respond_to?(:session) session.logger elsif Object.const_defined?(:ASSETS) ASSETS.session.logger elsif defined?(super) super else @logger ||= Eco::Language::BasicLogger.new end end # Shortcut to logger. def log(level, &block) logger&.send(level, &block) end end end end
Version data entries
22 entries across 22 versions & 1 rubygems