Sha256: f1136f433c84df84d90622b44a03f14fa9ae2bf389c3a6994a703a0dd5dcc505
Contents?: true
Size: 385 Bytes
Versions: 12
Compression:
Stored size: 385 Bytes
Contents
module EsReadModel class Logger def call(ctx) ctx = { time: Time.now }.merge(ctx) extras = ENV.select {|k,v| k =~ /^readmodel/i } ctx = ctx.merge(extras) STDERR.puts ctx.map {|k,v| format(k, v.to_s) }.join(' ') end private def format(k, v) value = (v =~ / /) ? "\"#{v}\"" : v "#{k}=#{value}" end end end
Version data entries
12 entries across 12 versions & 1 rubygems