Sha256: f4d3d785f78ad52b67c983c459b8e30f42e06cc6be220643fe184ec946c473ca

Contents?: true

Size: 247 Bytes

Versions: 25

Compression:

Stored size: 247 Bytes

Contents

module Ezlog
  module LogContextHelper
    def within_log_context(context)
      Logging.mdc.push context
      yield
    ensure
      Logging.mdc.pop
    end

    def add_to_log_context(context)
      Logging.mdc.update context
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
ezlog-0.3.4 lib/ezlog/log_context_helper.rb
ezlog-0.3.3 lib/ezlog/log_context_helper.rb
ezlog-0.3.2 lib/ezlog/log_context_helper.rb
ezlog-0.3.1 lib/ezlog/log_context_helper.rb
ezlog-0.2.2 lib/ezlog/log_context_helper.rb