Disable all logging kinds when logging in general is disabled
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kolaente 2019-01-24 13:14:32 +01:00
parent 8e02e9a162
commit 9a1eff5305
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -40,6 +40,12 @@ var Log = logging.MustGetLogger("vikunja")
// InitLogger initializes the global log handler
func InitLogger() {
if !viper.GetBool("log.enabled") {
// Disable all logging when loggin in general is disabled, overwriting everything a user might have set.
viper.Set("log.errors", "off")
viper.Set("log.standard", "off")
viper.Set("log.database", "off")
viper.Set("log.http", "off")
viper.Set("log.echo", "off")
return
}