Sha256: 4150979a4eecf53e1c7ed02d5560b1442984f2fb93e1c75f0788226f57595fc3
Contents?: true
Size: 808 Bytes
Versions: 5
Compression:
Stored size: 808 Bytes
Contents
# frozen_string_literal: true require_relative("logger/base") module Zapp # The default logger for Zapp class Logger include(Zapp::Logger::Base) def initialize yield(self) if block_given? end class << self # The hash key in Ractor.current that stores the global Zapp::Logger instance GLOBAL_INSTANCE_KEY = "ZAPP_LOGGER_INSTANCE" def instance Ractor.current[GLOBAL_INSTANCE_KEY] ||= new end private def method_missing(symbol, *args) if respond_to_missing?(symbol) instance.public_send(symbol, *args) else super end end def respond_to_missing?(symbol, include_private = false) instance.respond_to?(symbol) || super(symbol, include_private) end end end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
zapp-0.2.6 | lib/zapp/logger.rb |
zapp-0.2.5 | lib/zapp/logger.rb |
zapp-0.2.4 | lib/zapp/logger.rb |
zapp-0.2.3 | lib/zapp/logger.rb |
zapp-0.2.2 | lib/zapp/logger.rb |