Commit 48efc23b authored by Jordan Sissel's avatar Jordan Sissel

purge proto/msgpack; use json

parent 89ea13c6
......@@ -2,7 +2,7 @@ package liblumberjack
type FileEvent struct {
Source *string `json:"source,omitempty"`
Offset *uint64 `json:"offset,omitempty"`
Line *uint64 `json:"line,omitempty"`
Offset uint64 `json:"offset,omitempty"`
Line uint64 `json:"line,omitempty"`
Text *string `json:"text,omitempty"`
}
......@@ -6,7 +6,6 @@ import (
"bytes"
"io"
"bufio"
proto "code.google.com/p/goprotobuf/proto"
"time"
)
......@@ -65,9 +64,9 @@ func (h *Harvester) Harvest(output chan *FileEvent) {
line++
event := &FileEvent{
Source: proto.String(h.Path),
Offset: proto.Uint64(uint64(offset)),
Line: proto.Uint64(line),
Source: &h.Path,
Offset: uint64(offset),
Line: line,
Text: text,
}
offset += int64(len(*event.Text)) + 1 // +1 because of the line terminator
......
......@@ -2,7 +2,7 @@ package liblumberjack
import (
"log"
msgpack "github.com/ugorji/go-msgpack"
"encoding/json"
zmq "github.com/alecthomas/gozmq"
"math/big"
"syscall"
......@@ -171,10 +171,10 @@ func Publish(input chan []*FileEvent, server_list []string,
log.Printf("Spooler gave me %d events\n", len(events))
// Serialize with msgpack
data, err := msgpack.Marshal(events)
data, err := json.Marshal(events)
// TODO(sissel): chefk error
_ = err
//log.Printf("msgpack serialized %d bytes\n", len(data))
//log.Printf("json serialized %d bytes\n", len(data))
// Compress it
// A new compressor is used for every payload of events so
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment