From 02b478f4f9b9d74f62928e6fc7e8d84c97f46fce Mon Sep 17 00:00:00 2001 From: rmanach Date: Wed, 8 Jan 2025 11:41:07 +0100 Subject: [PATCH] fix logger + .env.example --- .env.example | 18 ++++++++++++------ main.go | 8 -------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.env.example b/.env.example index 6f94fa0..0dfa847 100644 --- a/.env.example +++ b/.env.example @@ -1,9 +1,15 @@ -API_ADMIN_USERNAME= # default to admin (must be set on production !) -API_ADMIN_PASSWORD= # default to admin (must be set on production !) +# default to admin (must be set on production !) +API_ADMIN_USERNAME= +# default to admin (must be set on production !) +API_ADMIN_PASSWORD= -API_SESSION_EXPIRATION_DURATION= # in seconds (default to 30s) +# in seconds (default to 30s) +API_SESSION_EXPIRATION_DURATION= -API_PORT= # defaul to 8585 -API_SECURE= # default to "false" +# default to 8585 +API_PORT= +# default to "false" +API_SECURE= -API_STORE_DIR= # default to "./store" \ No newline at end of file +# default to "./store" +API_STORE_DIR= \ No newline at end of file diff --git a/main.go b/main.go index 04daa9f..39b635f 100644 --- a/main.go +++ b/main.go @@ -9,7 +9,6 @@ import ( "strconv" "sync" - "github.com/rs/zerolog" "github.com/rs/zerolog/log" "librapi/handlers/download" @@ -45,14 +44,7 @@ var ( }) ) -func initLogger() { - zerolog.TimeFieldFormat = zerolog.TimeFormatUnix - log.Logger = log.With().Caller().Logger().Output(zerolog.ConsoleWriter{Out: os.Stderr}) -} - func main() { - initLogger() - ctx, fnCancel := signal.NotifyContext(context.Background(), os.Kill, os.Interrupt) defer fnCancel()