Skip to content

Commit

Permalink
initialize: remove New function
Browse files Browse the repository at this point in the history
The previous commit moved clairctl to using the refactored functions.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Mar 10, 2021
1 parent dc2f893 commit 8a2df09
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 90 deletions.
73 changes: 0 additions & 73 deletions initialize/init.go

This file was deleted.

17 changes: 0 additions & 17 deletions initialize/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,6 @@ import (
"github.com/quay/clair/v4/config"
)

// Logging will set the global logging level for Clair,
// create a global logger embedded into a CTX,
// and sets this CTX as our application's GlobalCTX.
func (i *Init) Logging() error {
// global log level
level := LogLevel(i.conf.LogLevel)
zerolog.SetGlobalLevel(level)

// attach global logger to ctx
i.GlobalCTX, i.GlobalCancel = context.WithCancel(context.Background())
globalLogger := log.With().Timestamp().Logger()
i.GlobalCTX = globalLogger.WithContext(i.GlobalCTX)

globalLogger.Info().Str("component", "init/Init.Logging").Msg("logging initialized")
return nil
}

// LogLevel does a string-to-level mapping.
func LogLevel(level string) zerolog.Level {
level = strings.ToLower(level)
Expand Down

0 comments on commit 8a2df09

Please sign in to comment.