mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
4bdd45c0cc
* refactor: introduce cmd internal package Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * changelog Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * informer Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * tracing Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * fix flag Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
16 lines
369 B
Go
16 lines
369 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, logLevel), "failed to setup logger")
|
|
return logging.WithName("setup")
|
|
}
|