From 2d7edca680b378b291a014d2edc4db667dc1058b Mon Sep 17 00:00:00 2001 From: Matthew Stobbs Date: Wed, 3 Apr 2024 23:43:54 -0600 Subject: [PATCH] moving log to custom simplelog --- lib/log/logs.go | 30 ------------------------------ main.go | 2 +- 2 files changed, 1 insertion(+), 31 deletions(-) delete mode 100644 lib/log/logs.go diff --git a/lib/log/logs.go b/lib/log/logs.go deleted file mode 100644 index 8b58f28..0000000 --- a/lib/log/logs.go +++ /dev/null @@ -1,30 +0,0 @@ -// Package logs provides a central location for ClustVirt logging, wrapping a Zerolog -// instance to do the job. -// This will standarize logging throughout ClustVirt, and make it easier to debug -// issues. -// The default is to log to Stderr -// TODO: enable logging to syslog through configuration -package log - -import ( - "os" - - "github.com/rs/zerolog" -) - -var defaultLogger zerolog.Logger - -func init() { - defaultLogger = zerolog.New(zerolog.ConsoleWriter{ - Out: os.Stderr, - TimeFormat: zerolog.TimeFormatUnix, - }) -} - -func Trace(method string) *zerolog.Event { return defaultLogger.Trace().Str("method", method) } -func Debug(method string) *zerolog.Event { return defaultLogger.Debug().Str("method", method) } -func Info(method string) *zerolog.Event { return defaultLogger.Info().Str("method", method) } -func Warn(method string) *zerolog.Event { return defaultLogger.Warn().Str("method", method) } -func Error(method string) *zerolog.Event { return defaultLogger.Error().Str("method", method) } -func Fatal(method string) *zerolog.Event { return defaultLogger.Fatal().Str("method", method) } -func Panic(method string) *zerolog.Event { return defaultLogger.Panic().Str("method", method) } diff --git a/main.go b/main.go index f603846..cf47df8 100644 --- a/main.go +++ b/main.go @@ -2,8 +2,8 @@ package main import ( "git.staur.ca/stobbsm/clustvirt/cluster" - "git.staur.ca/stobbsm/clustvirt/lib/log" "git.staur.ca/stobbsm/clustvirt/router/server" + log "git.staur.ca/stobbsm/simplelog" ) func main() {