Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1267)

Unified Diff: go/src/infra/tools/kitchen/cook_logdog.go

Issue 2174103002: Kitchen: always emit annotations if teeing. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/src/infra/tools/kitchen/cook.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/tools/kitchen/cook_logdog.go
diff --git a/go/src/infra/tools/kitchen/cook_logdog.go b/go/src/infra/tools/kitchen/cook_logdog.go
index 3dcd14752f85222c90470808376ca83020655b11..535199172bee0c6f5f79abaffab39d9dac75772e 100644
--- a/go/src/infra/tools/kitchen/cook_logdog.go
+++ b/go/src/infra/tools/kitchen/cook_logdog.go
@@ -91,6 +91,20 @@ func (p *cookLogDogParams) active() bool {
return p.host != "" || p.project != "" || p.prefix != ""
}
+// emitAnnotations returns true if the cook command should emit additional
+// annotations.
+//
+// If we're streaming solely to LogDog, it makes no sense to emit extra
+// annotations, since nothing will consume them; however, if we're tee-ing, we
+// will continue to emit additional annotations in case something is looking
+// at the tee'd output.
+//
+// Note that this could create an incongruity between the LogDog-emitted
+// annotations and the annotations in the STDOUT stream.
+func (p *cookLogDogParams) emitAnnotations() bool {
+ return p.tee || !p.active()
+}
+
func (p *cookLogDogParams) validate() error {
if p.project == "" {
return fmt.Errorf("a LogDog project must be supplied (-logdog-project)")
« no previous file with comments | « go/src/infra/tools/kitchen/cook.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698