From 5834e606339546621d1e06ed78374f0c71db3043 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 15 Jun 2023 11:38:10 +0200 Subject: [PATCH] cmd/thalos/main.go: move log init function to app/log/init.go --- app/log/init.go | 15 +++++++++++++++ cmd/thalos/main.go | 10 ---------- 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 app/log/init.go diff --git a/app/log/init.go b/app/log/init.go new file mode 100644 index 0000000..530a6a8 --- /dev/null +++ b/app/log/init.go @@ -0,0 +1,15 @@ +package log + +import ( + log "github.com/sirupsen/logrus" +) + +func init() { + // Initialize logger + formatter := log.TextFormatter{ + FullTimestamp: true, + TimestampFormat: "2006-01-02 15:04:05.0000", + } + + log.SetFormatter(&formatter) +} diff --git a/cmd/thalos/main.go b/cmd/thalos/main.go index e8e5b66..fbd7226 100644 --- a/cmd/thalos/main.go +++ b/cmd/thalos/main.go @@ -128,16 +128,6 @@ func run() { running = false } -func init() { - // Initialize logger - formatter := log.TextFormatter{ - FullTimestamp: true, - TimestampFormat: "2006-01-02 15:04:05.0000", - } - - log.SetFormatter(&formatter) -} - func getChain(def string) string { if len(conf.Ship.Chain) > 0 { return conf.Ship.Chain