From 4ac79cc44fefa604b496d9f9b0470aff8bb380fd Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 12 May 2019 19:21:22 +0200 Subject: [PATCH] Move logger into own logging package --- logger.go => logging/logging.go | 2 +- main.go | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) rename logger.go => logging/logging.go (99%) diff --git a/logger.go b/logging/logging.go similarity index 99% rename from logger.go rename to logging/logging.go index caa77df..369b973 100644 --- a/logger.go +++ b/logging/logging.go @@ -1,4 +1,4 @@ -package main +package logging import ( "io" diff --git a/main.go b/main.go index a9d735d..b2486b1 100644 --- a/main.go +++ b/main.go @@ -8,9 +8,13 @@ import ( "os" ) +import ( + "milter-experiment/logging" +) + var ( // Global logger for application wide logging. Not sure if this is a good pattern yet. - logger Logger + logger logging.Logger ) func handleMtaConnection(clientConnection *bufio.ReadWriter) { @@ -38,6 +42,6 @@ func handleMtaConnection(clientConnection *bufio.ReadWriter) { } func main() { - logger = NewLogger(os.Stdout, os.Stderr, DEBUG) + logger = logging.NewLogger(os.Stdout, os.Stderr, logging.DEBUG) runServer() }