1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00
kyverno/cmd/internal/logging.go
M Viswanath Sai d102abeb99
Feat: Human readable timestamps in logs (#9276)
* added timestamp flag and subsequent behaviour changes for logging

Signed-off-by: mviswanathsai <mviswanath.sai.met21@itbhu.ac.in>

* Changed verbose verbosity level in cli

Signed-off-by: mviswanathsai <mviswanath.sai.met21@itbhu.ac.in>

* fix linter

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

* log level

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

---------

Signed-off-by: mviswanathsai <mviswanath.sai.met21@itbhu.ac.in>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Co-authored-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
2024-02-01 19:14:47 +00:00

16 lines
386 B
Go

package internal
import (
"flag"
"strconv"
"github.com/go-logr/logr"
"github.com/kyverno/kyverno/pkg/logging"
)
func setupLogger() logr.Logger {
logLevel, err := strconv.Atoi(flag.Lookup("v").Value.String())
checkErr(err, "failed to setup logger")
checkErr(logging.Setup(loggingFormat, loggingTsFormat, logLevel), "failed to setup logger")
return logging.WithName("setup")
}