Module: Logging

Defined in:
lib/rubble/logging.rb

Class Method Summary collapse

Class Method Details

.context(*options) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/rubble/logging.rb', line 5

def context(*options)
    options.each do |option|
        option.each do |k, v|
            Logging.mdc[k] = v
        end
    end

    if block_given? then
        yield
    end
ensure
    options.each do |option|
        option.each do |k, v|
            Logging.mdc.delete(k)
        end
    end
end