Allow logging with blocks so that hoptoad works.
This commit is contained in:
parent
a4e6a019a7
commit
840901c0a8
1 changed files with 7 additions and 3 deletions
|
|
@ -5,9 +5,13 @@ module SplunkLogging
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def add_with_splunk(arg1, log_hash = nil, arg3 = nil, &block)
|
def add_with_splunk(arg1, log_hash = nil, arg3 = nil, &block)
|
||||||
string = format_hash(log_hash).dup
|
if log_hash
|
||||||
string << " pid=#{Process.pid} "
|
string = format_hash(log_hash).dup
|
||||||
string << " time=#{Time.now.to_i} "
|
string << " pid=#{Process.pid} "
|
||||||
|
string << " time=#{Time.now.to_i} "
|
||||||
|
else
|
||||||
|
string = log_hash
|
||||||
|
end
|
||||||
add_without_splunk(arg1, string, arg3, &block)
|
add_without_splunk(arg1, string, arg3, &block)
|
||||||
end
|
end
|
||||||
def format_hash(hash)
|
def format_hash(hash)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue