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

Unified Diff: logdog/client/cmd/logdog_butler/main.go

Issue 2595993002: Add Butler global tags. (Closed)
Patch Set: Mutate existing map. Created 4 years 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/butler/butler.go ('k') | logdog/client/cmd/logdog_butler/stream.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/client/cmd/logdog_butler/main.go
diff --git a/logdog/client/cmd/logdog_butler/main.go b/logdog/client/cmd/logdog_butler/main.go
index a6983d977596873d0e35fb3479cf268117f046d8..901e9202ab72b2b12f70796ee29ade3c81293c59 100644
--- a/logdog/client/cmd/logdog_butler/main.go
+++ b/logdog/client/cmd/logdog_butler/main.go
@@ -32,6 +32,7 @@ import (
grpcLogging "github.com/luci/luci-go/grpc/logging"
"github.com/luci/luci-go/logdog/client/butler"
"github.com/luci/luci-go/logdog/client/butler/output"
+ "github.com/luci/luci-go/logdog/client/butlerlib/streamproto"
"github.com/luci/luci-go/logdog/common/types"
)
@@ -65,6 +66,7 @@ type application struct {
authFlags authcli.Flags
+ globalTags streamproto.TagMap
maxBufferAge clockflag.Duration
noBufferLogs bool
@@ -101,6 +103,9 @@ func (a *application) addFlags(fs *flag.FlagSet) {
"The output name and configuration. Specify 'help' for more information.")
fs.IntVar(&a.outputWorkers, "output-workers", butler.DefaultOutputWorkers,
"The maximum number of parallel output dispatches.")
+ fs.Var(&a.globalTags, "tag",
+ "Specify key[=value] tags to be applied to all log streams. Individual treams may override. Can "+
+ "be specified multiple times.")
fs.Var(&a.maxBufferAge, "output-max-buffer-age",
"Send buffered messages if they've been held for longer than this period.")
fs.BoolVar(&a.noBufferLogs, "output-no-buffer", false,
@@ -142,6 +147,7 @@ func (a *application) runWithButler(out output.Output, runFunc func(*butler.Butl
butlerOpts := butler.Config{
Project: a.project,
Prefix: a.prefix,
+ GlobalTags: a.globalTags,
MaxBufferAge: time.Duration(a.maxBufferAge),
BufferLogs: !a.noBufferLogs,
Output: out,
« no previous file with comments | « logdog/client/butler/butler.go ('k') | logdog/client/cmd/logdog_butler/stream.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698