commit
9bc409d26b
|
@ -15,7 +15,6 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/containerd/containerd/pkg/seed"
|
||||
"github.com/containerd/containerd/pkg/userns"
|
||||
"github.com/containerd/containerd/platforms"
|
||||
|
@ -76,9 +75,6 @@ func init() {
|
|||
if reexec.Init() {
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
// overwrites containerd/log.G
|
||||
log.G = bklog.GetLogger
|
||||
}
|
||||
|
||||
var propagators = propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{})
|
||||
|
|
|
@ -3,10 +3,17 @@ package bklog
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/containerd/containerd/log"
|
||||
"github.com/sirupsen/logrus"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
)
|
||||
|
||||
func init() {
|
||||
// overwrites containerd/log
|
||||
log.G = GetLogger
|
||||
log.L = L
|
||||
}
|
||||
|
||||
var (
|
||||
G = GetLogger
|
||||
L = logrus.NewEntry(logrus.StandardLogger())
|
||||
|
@ -37,6 +44,8 @@ func GetLogger(ctx context.Context) (l *logrus.Entry) {
|
|||
|
||||
if logger != nil {
|
||||
l = logger.(*logrus.Entry)
|
||||
} else if logger := log.GetLogger(ctx); logger != nil {
|
||||
l = logger
|
||||
} else {
|
||||
l = L
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue