Sha256: 95d86e2ba7f633c239ca42d032f13b79593e9649408a2e11edeecd619f8b97e0

Contents?: true

Size: 813 Bytes

Versions: 3

Compression:

Stored size: 813 Bytes

Contents

# frozen_string_literal: true

require_relative 'logs/core'

module OnStrum
  module Logs
    class << self
      def configuration(&block)
        @configuration ||= begin
          return unless block

          configuration = OnStrum::Logs::Configuration.new(&block)
          raise OnStrum::Logs::Error::Configuration, OnStrum::Logs::Configuration::INCOMPLETE_CONFIG unless configuration.complete?

          configuration
        end
      end

      def configure(&block)
        configuration(&block)
      end

      def reset_configuration!
        @configuration = nil
      end

      OnStrum::Logs::Logger::Default::LOG_LEVELS.each do |method|
        define_method(method) do |*arg|
          OnStrum::Logs::Logger::Default.instance.public_send(method, *arg)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
on_strum-logs-0.3.0 lib/on_strum/logs.rb
on_strum-logs-0.2.0 lib/on_strum/logs.rb
on_strum-logs-0.1.1 lib/on_strum/logs.rb