Skip to content

Commit

Permalink
Add new enums.LogLevel to indicate skaffold's standard output (#6507)
Browse files Browse the repository at this point in the history
* add new log level to indicate skaffold's standard output

* fix description of new log level
  • Loading branch information
MarlonGamez committed Aug 25, 2021
1 parent da9ffe3 commit 997edc8
Show file tree
Hide file tree
Showing 7 changed files with 218 additions and 208 deletions.
1 change: 1 addition & 0 deletions docs/content/en/docs/references/api/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ Enum indicating the log level of a line of output
| FATAL | 4 | Fatal Level |
| PANIC | 5 | Panic Level |
| TRACE | 6 | Trace Level |
| STANDARD | 7 | User-visible output level |



Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/event/v2/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (l logger) Write(p []byte) (int, error) {
handler.handleSkaffoldLogEvent(&proto.SkaffoldLogEvent{
TaskId: fmt.Sprintf("%s-%d", l.Phase, handler.iteration),
SubtaskId: l.SubtaskID,
Level: -1,
Level: enums.LogLevel_STANDARD,
Message: string(p),
})

Expand Down
5 changes: 3 additions & 2 deletions pkg/skaffold/event/v2/status_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"fmt"

"github.com/GoogleContainerTools/skaffold/pkg/skaffold/constants"
"github.com/GoogleContainerTools/skaffold/proto/enums"
proto "github.com/GoogleContainerTools/skaffold/proto/v2"
)

Expand All @@ -37,7 +38,7 @@ func ResourceStatusCheckEventCompletedMessage(r string, message string, ae proto
TaskId: fmt.Sprintf("%s-%d", constants.Deploy, handler.iteration),
SubtaskId: r,
Message: message,
Level: -1,
Level: enums.LogLevel_STANDARD,
})
}

Expand Down Expand Up @@ -81,7 +82,7 @@ func ResourceStatusCheckEventUpdatedMessage(r string, message string, ae proto.A
TaskId: fmt.Sprintf("%s-%d", constants.Deploy, handler.iteration),
SubtaskId: r,
Message: fmt.Sprintf("%s %s\n", message, ae.Message),
Level: -1,
Level: enums.LogLevel_STANDARD,
})
}

Expand Down
414 changes: 209 additions & 205 deletions proto/enums/enums.pb.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions proto/enums/enums.proto
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ enum LogLevel {
PANIC = 5;
// Trace Level
TRACE = 6;
// User-visible output level
STANDARD = 7;
}

// Enum for Status codes<br>
Expand Down
1 change: 1 addition & 0 deletions proto/v1/skaffold.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions proto/v2/skaffold.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 997edc8

Please sign in to comment.