From 2ac79b8c2de5230e64e29dc9b18972e422856291 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 12 May 2019 19:11:59 +0200 Subject: [PATCH] Add .gitignore, make hexdump look better in log output --- .gitignore | 1 + main.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0570206 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +milter-experiment diff --git a/main.go b/main.go index a4e2d19..a9d735d 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( ) var ( + // Global logger for application wide logging. Not sure if this is a good pattern yet. logger Logger ) @@ -21,7 +22,7 @@ func handleMtaConnection(clientConnection *bufio.ReadWriter) { break } else { logger.Infof("Read %d bytes from connection\n", bytesRead) - logger.Debugf("%s", hex.Dump(buf[0:bytesRead])) + logger.Debugf("Hexdump of bytes read:\n%s", hex.Dump(buf[0:bytesRead])) // First 4 Bytes will be some integer thing "length" // Let's parse that