From 3d431cbdf134ecae51ead12220f9cef22299d9c6 Mon Sep 17 00:00:00 2001 From: Michael Aldridge Date: Sat, 27 Aug 2022 16:33:10 -0500 Subject: [PATCH] main: kludge logrus formatter into hclog a bit more --- main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 63ac794..697849e 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,6 @@ package main import ( - "log" "os" "os/signal" "strings" @@ -11,6 +10,7 @@ import ( "github.com/netauth/ldap/internal/ldap" "github.com/netauth/netauth/pkg/netauth" "github.com/spf13/viper" + log "github.com/sirupsen/logrus" ) func init() { @@ -36,6 +36,9 @@ func main() { // Take over the built in logger and set it up for Trace level // priority. The only thing that logs at this priority are // protocol messages from the underlying ldap server mux. + log.SetFormatter(&log.TextFormatter{ + DisableTimestamp: true, + }) log.SetOutput(appLogger.Named("ldap.protocol"). StandardWriter( &hclog.StandardLoggerOptions{ @@ -43,8 +46,6 @@ func main() { }, ), ) - log.SetPrefix("") - log.SetFlags(0) viper.SetConfigName("config") viper.AddConfigPath("/etc/netauth/")