Implement json tracer transport
This commit is contained in:
parent
8e6a01de6d
commit
ab86c5419d
20
node/modules/tracer/json_transport.go
Normal file
20
node/modules/tracer/json_transport.go
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
package tracer
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
type jsonTracerTransport struct {
|
||||||
|
out *os.File
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewJsonTracerTransport(out *os.File) TracerTransport {
|
||||||
|
return &jsonTracerTransport{
|
||||||
|
out: out,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (jtt *jsonTracerTransport) Transport(jsonEvent []byte) error {
|
||||||
|
_, err := jtt.out.Write(jsonEvent)
|
||||||
|
return err
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user