# frozen_string_literal: true module UU class Log include LogContext include Loggable def self.instance Thread.current[:logger] ||= new end def initialize @loggers = { stderr: LoggerStderr.new(self), fluent: LoggerFluent.new(self), } end attr_accessor :loggers %i[debug info warn error fatal].each do |severity| define_method(severity) do |*args, &block| @loggers.each_value.map do |logger| logger.send(severity, *args, &block) end end end end end