Move to use github.com/containerd/log

Add github.com/containerd/log to go.mod

Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
Derek McGowan
2023-09-11 21:16:16 -07:00
parent 3ebe5d1c56
commit 508aa3a1ef
242 changed files with 245 additions and 247 deletions

View File

@@ -29,10 +29,9 @@ import (
"strings"
"time"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/pkg/imageverifier"
"github.com/containerd/log"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus"
)
const outputLimitBytes = 1 << 15 // 32 KiB
@@ -188,7 +187,7 @@ func (v *ImageVerifier) runVerifier(ctx context.Context, bin string, imageName s
}()
// Pipe verifier stderr lines to debug logs.
stderrLog := log.G(ctx).Logger.WithFields(logrus.Fields{
stderrLog := log.G(ctx).Logger.WithFields(log.Fields{
"image_verifier": bin,
"stream": "stderr",
})

View File

@@ -29,9 +29,8 @@ import (
"text/template"
"time"
"github.com/containerd/containerd/log"
"github.com/containerd/log"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -91,7 +90,7 @@ func newBinDir(t *testing.T, srcDir string, bins ...string) string {
func TestBinDirVerifyImage(t *testing.T) {
// Enable debug logs to easily see stderr for verifiers upon test failure.
logger := log.L.Dup()
logger.Logger.SetLevel(logrus.DebugLevel)
logger.Logger.SetLevel(log.DebugLevel)
ctx := log.WithLogger(context.Background(), logger)
// Build verifiers from plain Go file.

View File

@@ -24,7 +24,7 @@ import (
"os/exec"
"unsafe"
"github.com/containerd/containerd/log"
"github.com/containerd/log"
"golang.org/x/sys/windows"
)