pkg/shim: remove logrus imports
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
ab61734e3d
commit
75fd7a5a7f
@ -43,7 +43,6 @@ import (
|
|||||||
"github.com/containerd/plugin"
|
"github.com/containerd/plugin"
|
||||||
"github.com/containerd/plugin/registry"
|
"github.com/containerd/plugin/registry"
|
||||||
"github.com/containerd/ttrpc"
|
"github.com/containerd/ttrpc"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Publisher for events
|
// Publisher for events
|
||||||
@ -171,12 +170,9 @@ func setRuntime() {
|
|||||||
|
|
||||||
func setLogger(ctx context.Context, id string) (context.Context, error) {
|
func setLogger(ctx context.Context, id string) (context.Context, error) {
|
||||||
l := log.G(ctx)
|
l := log.G(ctx)
|
||||||
l.Logger.SetFormatter(&logrus.TextFormatter{
|
_ = log.SetFormat(log.TextFormat)
|
||||||
TimestampFormat: log.RFC3339NanoFixed,
|
|
||||||
FullTimestamp: true,
|
|
||||||
})
|
|
||||||
if debugFlag {
|
if debugFlag {
|
||||||
l.Logger.SetLevel(log.DebugLevel)
|
_ = log.SetLevel("debug")
|
||||||
}
|
}
|
||||||
f, err := openLog(ctx, id)
|
f, err := openLog(ctx, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -30,7 +30,6 @@ import (
|
|||||||
"github.com/containerd/containerd/v2/pkg/sys/reaper"
|
"github.com/containerd/containerd/v2/pkg/sys/reaper"
|
||||||
"github.com/containerd/fifo"
|
"github.com/containerd/fifo"
|
||||||
"github.com/containerd/log"
|
"github.com/containerd/log"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -71,7 +70,7 @@ func serveListener(path string) (net.Listener, error) {
|
|||||||
return l, nil
|
return l, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func reap(ctx context.Context, logger *logrus.Entry, signals chan os.Signal) error {
|
func reap(ctx context.Context, logger *log.Entry, signals chan os.Signal) error {
|
||||||
logger.Debug("starting signal loop")
|
logger.Debug("starting signal loop")
|
||||||
|
|
||||||
for {
|
for {
|
||||||
@ -92,7 +91,7 @@ func reap(ctx context.Context, logger *logrus.Entry, signals chan os.Signal) err
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleExitSignals(ctx context.Context, logger *logrus.Entry, cancel context.CancelFunc) {
|
func handleExitSignals(ctx context.Context, logger *log.Entry, cancel context.CancelFunc) {
|
||||||
ch := make(chan os.Signal, 32)
|
ch := make(chan os.Signal, 32)
|
||||||
signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
|
signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
|
||||||
|
|
||||||
|
@ -23,8 +23,8 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/containerd/errdefs"
|
"github.com/containerd/errdefs"
|
||||||
|
"github.com/containerd/log"
|
||||||
"github.com/containerd/ttrpc"
|
"github.com/containerd/ttrpc"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func setupSignals(config Config) (chan os.Signal, error) {
|
func setupSignals(config Config) (chan os.Signal, error) {
|
||||||
@ -46,11 +46,11 @@ func serveListener(path string) (net.Listener, error) {
|
|||||||
return nil, errdefs.ErrNotImplemented
|
return nil, errdefs.ErrNotImplemented
|
||||||
}
|
}
|
||||||
|
|
||||||
func reap(ctx context.Context, logger *logrus.Entry, signals chan os.Signal) error {
|
func reap(ctx context.Context, logger *log.Entry, signals chan os.Signal) error {
|
||||||
return errdefs.ErrNotImplemented
|
return errdefs.ErrNotImplemented
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleExitSignals(ctx context.Context, logger *logrus.Entry, cancel context.CancelFunc) {
|
func handleExitSignals(ctx context.Context, logger *log.Entry, cancel context.CancelFunc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func openLog(ctx context.Context, _ string) (io.Writer, error) {
|
func openLog(ctx context.Context, _ string) (io.Writer, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user