mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-15 17:51:20 +00:00
d102abeb99
* 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>
16 lines
386 B
Go
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")
|
|
}
|