Sha256: 4d61449050dbe3e31ecdda4afb7838c5ec0cd19954fcd8e5a9784c7ded66f334

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

require_relative 'logs/version'
require_relative 'logs/configuration'
require_relative 'logs/result'
require_relative 'logs/driver/file'
require_relative 'logs/operations/dump'
require_relative 'logs/operations/searcher'
require_relative 'logs/formatter/timestamp'
require_relative 'logs/formatter/content/text'
require_relative 'logs/formatter/content/json'

module Trifle
  module Logs
    class Error < StandardError; end
    class DriverNotFound < Error; end

    def self.default
      @default ||= Configuration.new
    end

    def self.configure
      yield(default)

      default
    end

    def self.dump(namespace, payload, scope: {}, config: nil)
      Trifle::Logs::Operations::Dump.new(
        namespace: namespace,
        payload: payload,
        scope: scope,
        config: config
      ).perform
    end

    def self.searcher(namespace, pattern: nil, config: nil, min_loc: nil, max_loc: nil)
      Trifle::Logs::Operations::Searcher.new(
        namespace: namespace,
        pattern: pattern,
        config: config,
        min_loc: min_loc,
        max_loc: max_loc
      )
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
trifle-logs-0.2.1 lib/trifle/logs.rb
trifle-logs-0.2.0 lib/trifle/logs.rb
trifle-logs-0.1.0 lib/trifle/logs.rb