Move logger into own logging package

This commit is contained in:
Jan Philipp Timme 2019-05-12 19:21:22 +02:00
parent 2ac79b8c2d
commit 4ac79cc44f
2 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,4 @@
package main package logging
import ( import (
"io" "io"

View File

@ -8,9 +8,13 @@ import (
"os" "os"
) )
import (
"milter-experiment/logging"
)
var ( var (
// Global logger for application wide logging. Not sure if this is a good pattern yet. // 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) { func handleMtaConnection(clientConnection *bufio.ReadWriter) {
@ -38,6 +42,6 @@ func handleMtaConnection(clientConnection *bufio.ReadWriter) {
} }
func main() { func main() {
logger = NewLogger(os.Stdout, os.Stderr, DEBUG) logger = logging.NewLogger(os.Stdout, os.Stderr, logging.DEBUG)
runServer() runServer()
} }