# typed: ignore # Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.com/terms.html require 'sqreen/performance_notifications/log' require 'sqreen/performance_notifications/log_performance' require 'sqreen/configuration' require 'sqreen/logger' require 'sqreen/deferred_logger' # TODO: fold into Sqreen::Logger module Sqreen def self.log_init deferred_logger = @logger @logger = Sqreen::Logger.new( Sqreen.config_get(:log_level).to_s.upcase, Sqreen.config_get(:log_location) ) deferred_logger.flush_to(@logger.instance_eval { @logger }) rescue => e warn "Sqreen logger exception: #{e}" end def self::log @logger ||= Sqreen::DeferredLogger.new end end