Sha256: f9f0a1249f3be171a48339e1900e236e4979642435b261df5142dacc67c4bcf7

Contents?: true

Size: 596 Bytes

Versions: 8

Compression:

Stored size: 596 Bytes

Contents

module JLog
  module DSL
    def configure(path = nil, &block)
      @configurations ||= {}
      config = Configuration.new
      @configurations[path] = config
      block.call(config) if block
    end

    def get_config(path)
      return nil unless @configurations or @configurations[path]
      return @configurations[path]
    end

    def logger(path)
      config = get_config(path)
      return config.logger if config
      Rails.logger
    end

    def formatter(path)
      config = get_config(path)
      return config.formatter if config
      Formatter::Default
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jlog-rails-0.2.3 lib/jlog/dsl.rb
jlog-rails-0.2.2 lib/jlog/dsl.rb
jlog-rails-0.2.1 lib/jlog/dsl.rb
jlog-rails-0.2.0 lib/jlog/dsl.rb
jlog-rails-0.1.3 lib/jlog/dsl.rb
jlog-rails-0.1.2 lib/jlog/dsl.rb
jlog-rails-0.1.1 lib/jlog/dsl.rb
jlog-rails-0.1.0 lib/jlog/dsl.rb