Skip to content

Commit

Permalink
skaffold trace -> kaniko debug (#2823)
Browse files Browse the repository at this point in the history
  • Loading branch information
balopat authored and dgageot committed Sep 6, 2019
1 parent 39a5664 commit 33de1dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/skaffold/build/cluster/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ import (
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
)

// logLevel makes sure kaniko logs at least at Info level.
// logLevel makes sure kaniko logs at least at Info level and at most Debug level (trace doesn't work with Kaniko)
func logLevel() logrus.Level {
level := logrus.GetLevel()
if level < logrus.InfoLevel {
return logrus.InfoLevel
}
if level > logrus.DebugLevel {
return logrus.DebugLevel
}
return level
}

Expand Down
1 change: 1 addition & 0 deletions pkg/skaffold/build/cluster/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestLogLevel(t *testing.T) {
logrusLevel logrus.Level
expected logrus.Level
}{
{logrusLevel: logrus.TraceLevel, expected: logrus.DebugLevel},
{logrusLevel: logrus.DebugLevel, expected: logrus.DebugLevel},
{logrusLevel: logrus.InfoLevel, expected: logrus.InfoLevel},
{logrusLevel: logrus.WarnLevel, expected: logrus.InfoLevel},
Expand Down

0 comments on commit 33de1dd

Please sign in to comment.