Module: Lumberjack::JsonEncoder

Defined in:
lib/lumberjack/client.rb

Class Method Summary collapse

Class Method Details

.to_frame(hash, sequence) ⇒ Object


169
170
171
172
173
174
175
# File 'lib/lumberjack/client.rb', line 169

def self.to_frame(hash, sequence)
  json = Lumberjack::json.dump(hash)
  json_length = json.bytesize
  pack = "AANNA#{json_length}"
  frame = ["1", "J", sequence, json_length, json]
  frame.pack(pack)
end