Documentation ¶
Overview ¶
Package logging contains useful functionality
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
func Filter(logger *zap.SugaredLogger) func(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
Filter prometheus metric filter for go restful
func SetupLogger ¶
func SetupLogger(name string) *zap.SugaredLogger
SetupLogger should only be used as a fallback for a logger when
Types ¶
type ControllerLevel ¶
type ControllerLevel struct { Inherit bool Level zap.AtomicLevel }
ControllerLevel level for Controller
type Injector ¶
type Injector interface {
WithLogger(*zap.SugaredLogger)
}
Injector injects log into object
type LevelManager ¶
type LevelManager struct { BaseLevel zap.AtomicLevel ControllerLevelMap map[string]*ControllerLevel Locker *sync.Mutex Name string *zap.SugaredLogger }
LevelManager a manager for level. BaseLevel will be used when can't find level in ControllerLevelMap
func NewLevelManager ¶
func NewLevelManager(ctx context.Context, name string) LevelManager
NewLevelManager create a new levelManager object
func (*LevelManager) Get ¶
func (l *LevelManager) Get(name string) zap.AtomicLevel
Get find atomiclevel by name.If not found than insert one which inherit baselevel.
func (*LevelManager) SetLogger ¶
func (l *LevelManager) SetLogger(logger *zap.SugaredLogger)
SetLogger overwrites the previous logger
func (*LevelManager) Update ¶
func (l *LevelManager) Update() func(configMap *corev1.ConfigMap)
Update read a configmap to update LevelManager. Set BaseLevel with zap.Config, set ControllerLevels with LoggingLevel
Click to show internal directories.
Click to hide internal directories.