fix logger + .env.example

This commit is contained in:
rmanach 2025-01-08 11:41:07 +01:00
parent ff1bb89449
commit 02b478f4f9
2 changed files with 12 additions and 14 deletions

View File

@ -1,9 +1,15 @@
API_ADMIN_USERNAME= # default to admin (must be set on production !) # default to admin (must be set on production !)
API_ADMIN_PASSWORD= # 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 # default to 8585
API_SECURE= # default to "false" API_PORT=
# default to "false"
API_SECURE=
API_STORE_DIR= # default to "./store" # default to "./store"
API_STORE_DIR=

View File

@ -9,7 +9,6 @@ import (
"strconv" "strconv"
"sync" "sync"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"librapi/handlers/download" "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() { func main() {
initLogger()
ctx, fnCancel := signal.NotifyContext(context.Background(), os.Kill, os.Interrupt) ctx, fnCancel := signal.NotifyContext(context.Background(), os.Kill, os.Interrupt)
defer fnCancel() defer fnCancel()