Add verbosity flag to all services (#244)

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2022-07-01 16:17:06 +02:00 committed by GitHub
parent 3177b2fdb7
commit 0a874496b3
7 changed files with 44 additions and 17 deletions

View file

@ -12,14 +12,14 @@ import (
"github.com/edgelesssys/constellation/internal/logger"
"github.com/edgelesssys/constellation/verify/server"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func main() {
provider := flag.String("cloud-provider", "", "cloud service provider this binary is running on")
flag.Parse()
verbosity := flag.Int("v", 0, logger.CmdLineVerbosityDescription)
log := logger.New(logger.JSONLog, zapcore.InfoLevel)
flag.Parse()
log := logger.New(logger.JSONLog, logger.VerbosityFromInt(*verbosity))
log.With(zap.String("version", constants.VersionInfo), zap.String("cloudProvider", *provider)).
Infof("Constellation Verification Service")