Skip to content

Commit f261969

Browse files
committed
Move certain debug logs to trace logs
Signed-off-by: Kirtana Ashok <[email protected]>
1 parent 25252e9 commit f261969

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

cmd/ctr/commands/content/content.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ var (
424424

425425
ctx = log.WithLogger(ctx, log.G(ctx).WithField("ref", ref))
426426

427-
log.G(ctx).Debugf("resolving")
427+
log.G(ctx).Tracef("resolving")
428428
name, desc, err := resolver.Resolve(ctx, ref)
429429
if err != nil {
430430
return err
@@ -434,7 +434,7 @@ var (
434434
return err
435435
}
436436

437-
log.G(ctx).Debugf("fetching")
437+
log.G(ctx).Tracef("fetching")
438438
rc, err := fetcher.Fetch(ctx, desc)
439439
if err != nil {
440440
return err
@@ -475,7 +475,7 @@ var (
475475

476476
ctx = log.WithLogger(ctx, log.G(ctx).WithField("ref", ref))
477477

478-
log.G(ctx).Debugf("resolving")
478+
log.G(ctx).Tracef("resolving")
479479
fetcher, err := resolver.Fetcher(ctx, ref)
480480
if err != nil {
481481
return err
@@ -534,7 +534,7 @@ var (
534534

535535
ctx = log.WithLogger(ctx, log.G(ctx).WithField("ref", ref))
536536

537-
log.G(ctx).Debugf("resolving")
537+
log.G(ctx).Tracef("resolving")
538538
pusher, err := resolver.Pusher(ctx, ref)
539539
if err != nil {
540540
return err

gc/scheduler/scheduler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ func (s *gcScheduler) run(ctx context.Context) {
330330

331331
gcTime := stats.Elapsed()
332332
gcTimeHist.Update(gcTime)
333-
log.G(ctx).WithField("d", gcTime).Debug("garbage collected")
333+
log.G(ctx).WithField("d", gcTime).Trace("garbage collected")
334334
gcTimeSum += gcTime
335335
collections++
336336
collectionCounter.WithValues("success").Inc()

metadata/db.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ func (m *DB) cleanupSnapshotter(ctx context.Context, name string) (time.Duration
522522
if err != nil {
523523
logger.WithError(err).Warn("snapshot garbage collection failed")
524524
} else {
525-
logger.WithField("d", d).Debugf("snapshot garbage collected")
525+
logger.WithField("d", d).Tracef("snapshot garbage collected")
526526
}
527527
return d, err
528528
}
@@ -537,7 +537,7 @@ func (m *DB) cleanupContent(ctx context.Context) (time.Duration, error) {
537537
if err != nil {
538538
log.G(ctx).WithError(err).Warn("content garbage collection failed")
539539
} else {
540-
log.G(ctx).WithField("d", d).Debugf("content garbage collected")
540+
log.G(ctx).WithField("d", d).Tracef("content garbage collected")
541541
}
542542

543543
return d, err

pkg/cri/instrument/instrumented_service.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func (in *instrumentedService) ExecSync(ctx context.Context, r *runtime.ExecSync
270270
if err != nil {
271271
log.G(ctx).WithError(err).Errorf("ExecSync for %q failed", r.GetContainerId())
272272
} else {
273-
log.G(ctx).Debugf("ExecSync for %q returns with exit code %d", r.GetContainerId(), res.GetExitCode())
273+
log.G(ctx).Tracef("ExecSync for %q returns with exit code %d", r.GetContainerId(), res.GetExitCode())
274274
}
275275
}()
276276
res, err = in.c.ExecSync(ctrdutil.WithNamespace(ctx), r)
@@ -411,12 +411,12 @@ func (in *instrumentedService) ImageFsInfo(ctx context.Context, r *runtime.Image
411411
}
412412
ctx, span := tracing.StartSpan(ctx, tracing.Name(criSpanPrefix, "ImageFsInfo"))
413413
defer span.End()
414-
log.G(ctx).Debugf("ImageFsInfo")
414+
log.G(ctx).Tracef("ImageFsInfo")
415415
defer func() {
416416
if err != nil {
417417
log.G(ctx).WithError(err).Error("ImageFsInfo failed")
418418
} else {
419-
log.G(ctx).Debugf("ImageFsInfo returns filesystem info %+v", res.ImageFilesystems)
419+
log.G(ctx).Tracef("ImageFsInfo returns filesystem info %+v", res.ImageFilesystems)
420420
}
421421
span.SetStatus(err)
422422
}()
@@ -428,12 +428,12 @@ func (in *instrumentedService) PodSandboxStats(ctx context.Context, r *runtime.P
428428
if err := in.checkInitialized(); err != nil {
429429
return nil, err
430430
}
431-
log.G(ctx).Debugf("PodSandboxStats for %q", r.GetPodSandboxId())
431+
log.G(ctx).Tracef("PodSandboxStats for %q", r.GetPodSandboxId())
432432
defer func() {
433433
if err != nil {
434434
log.G(ctx).WithError(err).Errorf("PodSandboxStats for %q failed", r.GetPodSandboxId())
435435
} else {
436-
log.G(ctx).Debugf("PodSandboxStats for %q returns stats %+v", r.GetPodSandboxId(), res.GetStats())
436+
log.G(ctx).Tracef("PodSandboxStats for %q returns stats %+v", r.GetPodSandboxId(), res.GetStats())
437437
}
438438
}()
439439
res, err = in.c.PodSandboxStats(ctrdutil.WithNamespace(ctx), r)
@@ -444,12 +444,12 @@ func (in *instrumentedService) ContainerStats(ctx context.Context, r *runtime.Co
444444
if err := in.checkInitialized(); err != nil {
445445
return nil, err
446446
}
447-
log.G(ctx).Debugf("ContainerStats for %q", r.GetContainerId())
447+
log.G(ctx).Tracef("ContainerStats for %q", r.GetContainerId())
448448
defer func() {
449449
if err != nil {
450450
log.G(ctx).WithError(err).Errorf("ContainerStats for %q failed", r.GetContainerId())
451451
} else {
452-
log.G(ctx).Debugf("ContainerStats for %q returns stats %+v", r.GetContainerId(), res.GetStats())
452+
log.G(ctx).Tracef("ContainerStats for %q returns stats %+v", r.GetContainerId(), res.GetStats())
453453
}
454454
}()
455455
res, err = in.c.ContainerStats(ctrdutil.WithNamespace(ctx), r)
@@ -596,7 +596,7 @@ func (in *instrumentedService) ListMetricDescriptors(ctx context.Context, r *run
596596
if err != nil {
597597
log.G(ctx).WithError(err).Errorf("ListMetricDescriptors failed, error")
598598
} else {
599-
log.G(ctx).Debug("ListMetricDescriptors returns successfully")
599+
log.G(ctx).Trace("ListMetricDescriptors returns successfully")
600600
}
601601
}()
602602

@@ -613,7 +613,7 @@ func (in *instrumentedService) ListPodSandboxMetrics(ctx context.Context, r *run
613613
if err != nil {
614614
log.G(ctx).WithError(err).Errorf("ListPodSandboxMetrics failed, error")
615615
} else {
616-
log.G(ctx).Debug("ListPodSandboxMetrics returns successfully")
616+
log.G(ctx).Trace("ListPodSandboxMetrics returns successfully")
617617
}
618618
}()
619619

pkg/cri/io/logger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func redirectLogs(path string, rc io.ReadCloser, w io.Writer, s StreamType, maxL
167167
}
168168
if err != nil {
169169
if err == io.EOF {
170-
log.L.Debugf("Getting EOF from stream %q while redirecting to log file %q", s, path)
170+
log.L.Tracef("Getting EOF from stream %q while redirecting to log file %q", s, path)
171171
} else {
172172
log.L.WithError(err).Errorf("An error occurred when redirecting stream %q to log file %q", s, path)
173173
}

pkg/cri/server/container_execsync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ func drainExecSyncIO(ctx context.Context, execProcess containerd.Process, drainE
293293
select {
294294
case <-timerCh:
295295
case <-attachDone:
296-
log.G(ctx).Debugf("Stream pipe for exec process %q done", execProcess.ID())
296+
log.G(ctx).Tracef("Stream pipe for exec process %q done", execProcess.ID())
297297
return nil
298298
}
299299

0 commit comments

Comments
 (0)