Example #1
0
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()
}
Example #2
0
func printDataEventFull(ev *event.DataEvent) {
	out.EntryBegin(ev.Stamp, ev.Kind, ev.Cid, len(ev.Payload))
	printPayloadFull(ev.Payload)
	out.EntryEnd()
}
Example #3
0
// 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()
}
Example #4
0
func printMessageEventShort(ev *event.MessageEvent) {
	out.EntryBegin(ev.Stamp, ev.Kind, ev.Cid, 0)
	out.Out.WriteString(ev.Message)
	out.EntryEnd()
}
Example #5
0
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()
}