func printDisconnectEventShort(ev *event.DisconnectEvent) { out.EntryBegin(ev.Stamp, ev.Kind, ev.Cid, 0) if ev.Initiator == event.Send { // Send stream was closed -> Client out.Out.WriteString("Client closed connection") } else { out.Out.WriteString("Server closed connection") } out.EntryEnd() }
func printDataEventFull(ev *event.DataEvent) { out.EntryBegin(ev.Stamp, ev.Kind, ev.Cid, len(ev.Payload)) printPayloadFull(ev.Payload) out.EntryEnd() }
// HTTP event examples: // 15:04:05.000 ->1 GET / HTTP/1.0 // 15:04:05.000 <-1 HTTP/1.0 OK func printHttpEventShort(ev *event.HttpEvent) { out.EntryBegin(ev.Stamp, ev.Kind, ev.Cid, len(ev.Payload)) printHttpDescShort(ev) out.EntryEnd() }
func printMessageEventShort(ev *event.MessageEvent) { out.EntryBegin(ev.Stamp, ev.Kind, ev.Cid, 0) out.Out.WriteString(ev.Message) out.EntryEnd() }
func printConnectEventShort(ev *event.ConnectEvent) { out.EntryBegin(ev.Stamp, ev.Kind, ev.Cid, 0) out.Out.WriteString("New connection from ") out.Out.WriteString(ev.From) out.EntryEnd() }