Migrate to structured logging (klog)
This commit is contained in:
parent
93ac8d5a21
commit
108637bb1c
31 changed files with 161 additions and 171 deletions
|
|
@ -60,7 +60,7 @@ func setupLeaderElection(config *leaderElectionConfig) {
|
|||
var stopCh chan struct{}
|
||||
callbacks := leaderelection.LeaderCallbacks{
|
||||
OnStartedLeading: func(ctx context.Context) {
|
||||
klog.V(2).Infof("I am the new leader")
|
||||
klog.V(2).InfoS("I am the new leader")
|
||||
stopCh = make(chan struct{})
|
||||
|
||||
if config.OnStartedLeading != nil {
|
||||
|
|
@ -68,7 +68,7 @@ func setupLeaderElection(config *leaderElectionConfig) {
|
|||
}
|
||||
},
|
||||
OnStoppedLeading: func() {
|
||||
klog.V(2).Info("I am not leader anymore")
|
||||
klog.V(2).InfoS("I am not leader anymore")
|
||||
close(stopCh)
|
||||
|
||||
// cancel the context
|
||||
|
|
@ -81,7 +81,7 @@ func setupLeaderElection(config *leaderElectionConfig) {
|
|||
}
|
||||
},
|
||||
OnNewLeader: func(identity string) {
|
||||
klog.Infof("new leader elected: %v", identity)
|
||||
klog.InfoS("New leader elected", "identity", identity)
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue