Add a timestamp to splunk-style logs

This commit is contained in:
Raphael Sofaer 2011-08-05 12:18:19 -07:00
parent 9e007f2b11
commit 78a8dc82f4

View file

@ -7,6 +7,7 @@ module SplunkLogging
def add_with_splunk(arg1, log_hash = nil, arg3 = nil, &block)
string = format_hash(log_hash).dup
string << " pid=#{Process.pid} "
string << " time=#{Time.now.to_i} "
add_without_splunk(arg1, string, arg3, &block)
end
def format_hash(hash)