Merge pull request #9626 from kiashok/debugToTraceLogs
Move certain debug level logs to trace level logs
This commit is contained in:
commit
a2f167e836
@ -424,7 +424,7 @@ var (
|
||||
|
||||
ctx = log.WithLogger(ctx, log.G(ctx).WithField("ref", ref))
|
||||
|
||||
log.G(ctx).Debugf("resolving")
|
||||
log.G(ctx).Tracef("resolving")
|
||||
name, desc, err := resolver.Resolve(ctx, ref)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -434,7 +434,7 @@ var (
|
||||
return err
|
||||
}
|
||||
|
||||
log.G(ctx).Debugf("fetching")
|
||||
log.G(ctx).Tracef("fetching")
|
||||
rc, err := fetcher.Fetch(ctx, desc)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -475,7 +475,7 @@ var (
|
||||
|
||||
ctx = log.WithLogger(ctx, log.G(ctx).WithField("ref", ref))
|
||||
|
||||
log.G(ctx).Debugf("resolving")
|
||||
log.G(ctx).Tracef("resolving")
|
||||
fetcher, err := resolver.Fetcher(ctx, ref)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -534,7 +534,7 @@ var (
|
||||
|
||||
ctx = log.WithLogger(ctx, log.G(ctx).WithField("ref", ref))
|
||||
|
||||
log.G(ctx).Debugf("resolving")
|
||||
log.G(ctx).Tracef("resolving")
|
||||
pusher, err := resolver.Pusher(ctx, ref)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -330,7 +330,7 @@ func (s *gcScheduler) run(ctx context.Context) {
|
||||
|
||||
gcTime := stats.Elapsed()
|
||||
gcTimeHist.Update(gcTime)
|
||||
log.G(ctx).WithField("d", gcTime).Debug("garbage collected")
|
||||
log.G(ctx).WithField("d", gcTime).Trace("garbage collected")
|
||||
gcTimeSum += gcTime
|
||||
collections++
|
||||
collectionCounter.WithValues("success").Inc()
|
||||
|
@ -522,7 +522,7 @@ func (m *DB) cleanupSnapshotter(ctx context.Context, name string) (time.Duration
|
||||
if err != nil {
|
||||
logger.WithError(err).Warn("snapshot garbage collection failed")
|
||||
} else {
|
||||
logger.WithField("d", d).Debugf("snapshot garbage collected")
|
||||
logger.WithField("d", d).Tracef("snapshot garbage collected")
|
||||
}
|
||||
return d, err
|
||||
}
|
||||
@ -537,7 +537,7 @@ func (m *DB) cleanupContent(ctx context.Context) (time.Duration, error) {
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Warn("content garbage collection failed")
|
||||
} else {
|
||||
log.G(ctx).WithField("d", d).Debugf("content garbage collected")
|
||||
log.G(ctx).WithField("d", d).Tracef("content garbage collected")
|
||||
}
|
||||
|
||||
return d, err
|
||||
|
@ -270,7 +270,7 @@ func (in *instrumentedService) ExecSync(ctx context.Context, r *runtime.ExecSync
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Errorf("ExecSync for %q failed", r.GetContainerId())
|
||||
} else {
|
||||
log.G(ctx).Debugf("ExecSync for %q returns with exit code %d", r.GetContainerId(), res.GetExitCode())
|
||||
log.G(ctx).Tracef("ExecSync for %q returns with exit code %d", r.GetContainerId(), res.GetExitCode())
|
||||
}
|
||||
}()
|
||||
res, err = in.c.ExecSync(ctrdutil.WithNamespace(ctx), r)
|
||||
@ -411,12 +411,12 @@ func (in *instrumentedService) ImageFsInfo(ctx context.Context, r *runtime.Image
|
||||
}
|
||||
ctx, span := tracing.StartSpan(ctx, tracing.Name(criSpanPrefix, "ImageFsInfo"))
|
||||
defer span.End()
|
||||
log.G(ctx).Debugf("ImageFsInfo")
|
||||
log.G(ctx).Tracef("ImageFsInfo")
|
||||
defer func() {
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Error("ImageFsInfo failed")
|
||||
} else {
|
||||
log.G(ctx).Debugf("ImageFsInfo returns filesystem info %+v", res.ImageFilesystems)
|
||||
log.G(ctx).Tracef("ImageFsInfo returns filesystem info %+v", res.ImageFilesystems)
|
||||
}
|
||||
span.SetStatus(err)
|
||||
}()
|
||||
@ -428,12 +428,12 @@ func (in *instrumentedService) PodSandboxStats(ctx context.Context, r *runtime.P
|
||||
if err := in.checkInitialized(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.G(ctx).Debugf("PodSandboxStats for %q", r.GetPodSandboxId())
|
||||
log.G(ctx).Tracef("PodSandboxStats for %q", r.GetPodSandboxId())
|
||||
defer func() {
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Errorf("PodSandboxStats for %q failed", r.GetPodSandboxId())
|
||||
} else {
|
||||
log.G(ctx).Debugf("PodSandboxStats for %q returns stats %+v", r.GetPodSandboxId(), res.GetStats())
|
||||
log.G(ctx).Tracef("PodSandboxStats for %q returns stats %+v", r.GetPodSandboxId(), res.GetStats())
|
||||
}
|
||||
}()
|
||||
res, err = in.c.PodSandboxStats(ctrdutil.WithNamespace(ctx), r)
|
||||
@ -444,12 +444,12 @@ func (in *instrumentedService) ContainerStats(ctx context.Context, r *runtime.Co
|
||||
if err := in.checkInitialized(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.G(ctx).Debugf("ContainerStats for %q", r.GetContainerId())
|
||||
log.G(ctx).Tracef("ContainerStats for %q", r.GetContainerId())
|
||||
defer func() {
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Errorf("ContainerStats for %q failed", r.GetContainerId())
|
||||
} else {
|
||||
log.G(ctx).Debugf("ContainerStats for %q returns stats %+v", r.GetContainerId(), res.GetStats())
|
||||
log.G(ctx).Tracef("ContainerStats for %q returns stats %+v", r.GetContainerId(), res.GetStats())
|
||||
}
|
||||
}()
|
||||
res, err = in.c.ContainerStats(ctrdutil.WithNamespace(ctx), r)
|
||||
@ -596,7 +596,7 @@ func (in *instrumentedService) ListMetricDescriptors(ctx context.Context, r *run
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Errorf("ListMetricDescriptors failed, error")
|
||||
} else {
|
||||
log.G(ctx).Debug("ListMetricDescriptors returns successfully")
|
||||
log.G(ctx).Trace("ListMetricDescriptors returns successfully")
|
||||
}
|
||||
}()
|
||||
|
||||
@ -613,7 +613,7 @@ func (in *instrumentedService) ListPodSandboxMetrics(ctx context.Context, r *run
|
||||
if err != nil {
|
||||
log.G(ctx).WithError(err).Errorf("ListPodSandboxMetrics failed, error")
|
||||
} else {
|
||||
log.G(ctx).Debug("ListPodSandboxMetrics returns successfully")
|
||||
log.G(ctx).Trace("ListPodSandboxMetrics returns successfully")
|
||||
}
|
||||
}()
|
||||
|
||||
|
@ -167,7 +167,7 @@ func redirectLogs(path string, rc io.ReadCloser, w io.Writer, s StreamType, maxL
|
||||
}
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
log.L.Debugf("Getting EOF from stream %q while redirecting to log file %q", s, path)
|
||||
log.L.Tracef("Getting EOF from stream %q while redirecting to log file %q", s, path)
|
||||
} else {
|
||||
log.L.WithError(err).Errorf("An error occurred when redirecting stream %q to log file %q", s, path)
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ func drainExecSyncIO(ctx context.Context, execProcess containerd.Process, drainE
|
||||
select {
|
||||
case <-timerCh:
|
||||
case <-attachDone:
|
||||
log.G(ctx).Debugf("Stream pipe for exec process %q done", execProcess.ID())
|
||||
log.G(ctx).Tracef("Stream pipe for exec process %q done", execProcess.ID())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user