Sha256: de67ba4f77a16363a13273495238305501ff5138b4e195efcad54385cfdad68f
Contents?: true
Size: 797 Bytes
Versions: 9
Compression:
Stored size: 797 Bytes
Contents
module LogjamAgent module LoggingAttributes extend self def attributes=(attributes) Thread.current.thread_variable_set(:__logjam_agent_logging_attributes__, attributes) end def attributes Thread.current.thread_variable_get(:__logjam_agent_logging_attributes__) || Thread.current.thread_variable_set(:__logjam_agent_logging_attributes__, []) end def set_attribute(name, value) if attribute = attributes.detect{|n,v| n == name} attribute[1] = value else attributes << [name, value] end end def reset_attributes self.attributes = [] end def render_attributes attrs = attributes.select{|k,v| !k.nil? } attrs.empty? ? nil : attrs.map{|k,v| "#{k}=#{v}"}.join(" ") end end end
Version data entries
9 entries across 9 versions & 1 rubygems