Refactor logger (#1185)

* refactor: logger

* refactor: logging

* refactor: rename func

* refactor: logging

* refactor: logging format
This commit is contained in:
Kota Kanbe
2021-02-26 10:36:58 +09:00
committed by GitHub
parent 518f4dc039
commit 3f2ac45d71
58 changed files with 455 additions and 408 deletions

View File

@@ -10,8 +10,8 @@ import (
"github.com/BurntSushi/toml"
c "github.com/future-architect/vuls/config"
"github.com/future-architect/vuls/logging"
"github.com/future-architect/vuls/models"
"github.com/future-architect/vuls/util"
"github.com/hashicorp/go-uuid"
"golang.org/x/xerrors"
)
@@ -48,7 +48,7 @@ func ensure(servers map[string]c.ServerInfo, path string, scanResults models.Sca
needsOverwrite = true
} else if _, err := uuid.ParseUUID(id); err != nil {
// if the UUID of the host is invalid, re-generate it
util.Log.Warnf("UUID `%s` is invalid. Re-generate and overwrite", id)
logging.Log.Warnf("UUID `%s` is invalid. Re-generate and overwrite", id)
serverInfo.UUIDs[r.ServerName], err = generateFunc()
if err != nil {
return false, err
@@ -74,7 +74,7 @@ func ensure(servers map[string]c.ServerInfo, path string, scanResults models.Sca
continue
}
// re-generate
util.Log.Warnf("UUID `%s` is invalid. Re-generate and overwrite", id)
logging.Log.Warnf("UUID `%s` is invalid. Re-generate and overwrite", id)
}
// Generate a new UUID and set to config and scanResult