feat: Allow disabling debug logging
This commit is contained in:
parent
e390ca6047
commit
731a3ce2cb
@ -78,7 +78,6 @@ func Handler(pagesDomain, giteaUrl string, giteaClient *gitea.Client) http.Handl
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runServer(ctx *cli.Context) error {
|
func runServer(ctx *cli.Context) error {
|
||||||
log.SetLevel(log.DebugLevel)
|
|
||||||
giteaUrl := ctx.String("gitea-url")
|
giteaUrl := ctx.String("gitea-url")
|
||||||
domain := ctx.String("pages-domain")
|
domain := ctx.String("pages-domain")
|
||||||
certsFile := ctx.String("certs-file")
|
certsFile := ctx.String("certs-file")
|
||||||
@ -89,6 +88,13 @@ func runServer(ctx *cli.Context) error {
|
|||||||
acmePort := ctx.String("acme-port")
|
acmePort := ctx.String("acme-port")
|
||||||
acmeDisable := ctx.Bool("acme-disable")
|
acmeDisable := ctx.Bool("acme-disable")
|
||||||
|
|
||||||
|
// Init Logging
|
||||||
|
if ctx.Bool("debug") {
|
||||||
|
log.SetLevel(log.DebugLevel)
|
||||||
|
} else {
|
||||||
|
log.SetLevel(log.InfoLevel)
|
||||||
|
}
|
||||||
|
|
||||||
// Setup the Gitea stuff
|
// Setup the Gitea stuff
|
||||||
httpClient := http.Client{Timeout: 10 * time.Second}
|
httpClient := http.Client{Timeout: 10 * time.Second}
|
||||||
client, err := gitea.NewClient(
|
client, err := gitea.NewClient(
|
||||||
@ -237,6 +243,11 @@ func main() {
|
|||||||
Usage: "Whether to disable automatic ACME certificates",
|
Usage: "Whether to disable automatic ACME certificates",
|
||||||
EnvVars: []string{"ACME_DISABLE"},
|
EnvVars: []string{"ACME_DISABLE"},
|
||||||
},
|
},
|
||||||
|
&cli.BoolFlag{
|
||||||
|
Name: "debug",
|
||||||
|
Usage: "Whether to enable debug logging",
|
||||||
|
EnvVars: []string{"DEBUG_ENABLE"},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user