Add --verbose flag and hide debug messages by default

This commit is contained in:
Moritz Marquardt 2021-12-10 14:32:14 +01:00
parent 73fa2da646
commit adfc96ab94
No known key found for this signature in database
GPG key ID: D5788327BEE388B6
3 changed files with 13 additions and 1 deletions

View file

@ -10,6 +10,7 @@ import (
"strings"
"time"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/urfave/cli/v2"
@ -34,6 +35,11 @@ var BlacklistedPaths = [][]byte{
// Serve sets up and starts the web server.
func Serve(ctx *cli.Context) error {
verbose := ctx.Bool("verbose")
if !verbose {
zerolog.SetGlobalLevel(zerolog.InfoLevel)
}
giteaRoot := strings.TrimSuffix(ctx.String("gitea-root"), "/")
giteaAPIToken := ctx.String("gitea-api-token")
rawDomain := ctx.String("raw-domain")