mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-17 23:59:11 +02:00
* somehow now the only thing that doesnt work is devices.Device Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * this gets rid of all the compiler errors in the vendored code Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * fixed some things but a bunch of tests and maybe some compiler steps are still failing Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * all the things i figured out how to fix so far Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * guess i had to redo go mods after rebasing again Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * update docker constants to be SHOUTY CASE now Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * include DestPath in resolveEnv Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * fix one mistake in Docker lib upgrade and some typos/deprecations in the file Signed-off-by: Joe Kimmel <jkimmel@vmware.com> * last changes (hopefully) to update to new docker libs Signed-off-by: Joe Kimmel <jkimmel@vmware.com> --------- Signed-off-by: Joe Kimmel <jkimmel@vmware.com>
32 lines
874 B
Go
32 lines
874 B
Go
package log
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
"google.golang.org/grpc/grpclog"
|
|
)
|
|
|
|
type logrusWrapper struct {
|
|
*logrus.Entry
|
|
}
|
|
|
|
// V provides the functionality that returns whether a particular log level is at
|
|
// least l - this is needed to meet the LoggerV2 interface. GRPC's logging levels
|
|
// are: https://github.com/grpc/grpc-go/blob/master/grpclog/loggerv2.go#L71
|
|
// 0=info, 1=warning, 2=error, 3=fatal
|
|
// logrus's are: https://github.com/sirupsen/logrus/blob/master/logrus.go
|
|
// 0=panic, 1=fatal, 2=error, 3=warn, 4=info, 5=debug
|
|
func (lw logrusWrapper) V(l int) bool {
|
|
// translate to logrus level
|
|
logrusLevel := 4 - l
|
|
return int(lw.Logger.Level) <= logrusLevel
|
|
}
|
|
|
|
func init() {
|
|
ctx := WithModule(context.Background(), "grpc")
|
|
|
|
// completely replace the grpc logger with the logrus logger.
|
|
grpclog.SetLoggerV2(logrusWrapper{Entry: G(ctx)})
|
|
}
|