fix logger + .env.example
This commit is contained in:
parent
ff1bb89449
commit
02b478f4f9
18
.env.example
18
.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"
|
||||
# default to "./store"
|
||||
API_STORE_DIR=
|
||||
8
main.go
8
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()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user