mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-17 11:57:12 +03:00
Log levels.
This commit is contained in:
parent
c9596cd09d
commit
d8cf6f4256
5
main.go
5
main.go
@ -20,6 +20,7 @@ import (
|
|||||||
|
|
||||||
var repo = flag.String("repo", "", "url to the repo")
|
var repo = flag.String("repo", "", "url to the repo")
|
||||||
var checksToRun = flag.String("checks", "", "specific checks to run, instead of all")
|
var checksToRun = flag.String("checks", "", "specific checks to run, instead of all")
|
||||||
|
var logLevel = zap.LevelFlag("verbosity", zap.InfoLevel, "override the default log level")
|
||||||
|
|
||||||
type result struct {
|
type result struct {
|
||||||
cr checker.CheckResult
|
cr checker.CheckResult
|
||||||
@ -28,7 +29,9 @@ type result struct {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
logger, _ := zap.NewProduction()
|
cfg := zap.NewProductionConfig()
|
||||||
|
cfg.Level.SetLevel(*logLevel)
|
||||||
|
logger, _ := cfg.Build()
|
||||||
defer logger.Sync() // flushes buffer, if any
|
defer logger.Sync() // flushes buffer, if any
|
||||||
sugar := logger.Sugar()
|
sugar := logger.Sugar()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user