lib/hedgelog.rb in hedgelog-0.2.1.alpha.3 vs lib/hedgelog.rb in hedgelog-0.2.1.alpha.4
- old
+ new
@@ -3,11 +3,11 @@
require 'hedgelog/version'
require 'hedgelog/context'
require 'hedgelog/scrubber'
require 'hedgelog/normalizer'
require 'logger'
-require 'yajl'
+require 'json'
class Hedgelog
LEVELS = %w[DEBUG INFO WARN ERROR FATAL UNKNOWN].each_with_object({}).with_index do |(v, h), i|
h[v] = i
h[v.downcase] = i
@@ -149,10 +149,10 @@
data = context.merge(default_data(severity))
data[:app] = @app if @app
data[:caller] = debugharder(caller(4, 1).first) if debug?
data = extract_top_level_keys(data)
- @logdev.write("#{Yajl::Encoder.encode(data)}\n")
+ @logdev.write("#{JSON.generate(data)}\n")
true
end
private def default_data(severity)
{