Add .gitignore, make hexdump look better in log output

This commit is contained in:
Jan Philipp Timme 2019-05-12 19:11:59 +02:00
parent 2e4d5eae8a
commit 2ac79b8c2d
2 changed files with 3 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
milter-experiment

View File

@ -9,6 +9,7 @@ import (
) )
var ( var (
// Global logger for application wide logging. Not sure if this is a good pattern yet.
logger Logger logger Logger
) )
@ -21,7 +22,7 @@ func handleMtaConnection(clientConnection *bufio.ReadWriter) {
break break
} else { } else {
logger.Infof("Read %d bytes from connection\n", bytesRead) 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" // First 4 Bytes will be some integer thing "length"
// Let's parse that // Let's parse that