mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-28 13:55:47 +00:00
✨ Use github.com/rs/zerolog
for logging (#1255)
* Use `github.com/rs/zerolog` for logging * Use `github.com/rs/zerolog` for logging (continue) * Add `debug` flag * Remove `github.com/op/go-logging` dependency completely * Fix linter
This commit is contained in:
@@ -4,12 +4,11 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/kubeshark/kubeshark/debounce"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
)
|
||||
|
||||
@@ -57,13 +56,13 @@ func FilteredWatch(ctx context.Context, watcherCreator WatchCreator, targetNames
|
||||
} else {
|
||||
if !watchRestartDebouncer.IsOn() {
|
||||
if err := watchRestartDebouncer.SetOn(); err != nil {
|
||||
log.Print(err)
|
||||
log.Error().Err(err)
|
||||
}
|
||||
log.Print("k8s watch channel closed, restarting watcher")
|
||||
log.Warn().Msg("K8s watch channel closed, restarting watcher...")
|
||||
time.Sleep(time.Second * 5)
|
||||
continue
|
||||
} else {
|
||||
errorChan <- errors.New("k8s watch unstable, closes frequently")
|
||||
errorChan <- errors.New("K8s watch unstable, closes frequently")
|
||||
break
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user