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

Unified Diff: logdog/client/annotee/processor.go

Issue 2698413005: Annotee: Allow annotation subpath to be specified. (Closed)
Patch Set: Created 3 years, 10 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 | « logdog/client/annotee/annotation/annotation.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/client/annotee/processor.go
diff --git a/logdog/client/annotee/processor.go b/logdog/client/annotee/processor.go
index a6e82ba66e77a516b8d9519da9c9c33a9bb94340..4b43142ccd1e80c91a54e8e2ab577c1adf5cd10d 100644
--- a/logdog/client/annotee/processor.go
+++ b/logdog/client/annotee/processor.go
@@ -37,6 +37,10 @@ const (
STDOUT = types.StreamName("stdout")
// STDERR is the system STDERR stream.
STDERR = types.StreamName("stderr")
+
+ // DefaultAnnotationSubpath is the default annotation subpath. It will be used
+ // if an explicit subpath is not provided.
+ DefaultAnnotationSubpath = types.StreamName("annotations")
)
// Stream describes a single process stream.
@@ -84,6 +88,11 @@ type Options struct {
// Base is the base log stream name. This is prepended to every log name, as
// well as any generate log names.
Base types.StreamName
+ // AnnotationSubpath is the path underneath of Base where the annotation
+ // stream will be written.
+ //
+ // If empty, DefaultAnnotationSubpath will be used.
+ AnnotationSubpath types.StreamName
// LinkGenerator generates links to alias for a given log stream.
//
@@ -171,8 +180,14 @@ func (p *Processor) initialize() (err error) {
return nil
}
+ annotationPath := p.o.AnnotationSubpath
+ if annotationPath == "" {
+ annotationPath = DefaultAnnotationSubpath
+ }
+ annotationPath = p.astate.RootStep().BaseStream(annotationPath)
+
// Create our annotation stream.
- if p.annotationStream, err = p.createStream(p.astate.AnnotationStream(), &metadataStreamArchetype); err != nil {
+ if p.annotationStream, err = p.createStream(annotationPath, &metadataStreamArchetype); err != nil {
log.WithError(err).Errorf(p.ctx, "Failed to create annotation stream.")
return
}
« no previous file with comments | « logdog/client/annotee/annotation/annotation.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698