| Index: logdog/client/butler/butler.go
|
| diff --git a/logdog/client/butler/butler.go b/logdog/client/butler/butler.go
|
| index 80b0d04cf94be17b921e34e2b8811c5a6f89f7b5..f8a1d134fcd77ffbb5410fb03018a9b478255ef7 100644
|
| --- a/logdog/client/butler/butler.go
|
| +++ b/logdog/client/butler/butler.go
|
| @@ -25,6 +25,7 @@ import (
|
| "github.com/luci/luci-go/logdog/client/butler/streamserver"
|
| "github.com/luci/luci-go/logdog/client/butlerlib/streamproto"
|
| "github.com/luci/luci-go/logdog/common/types"
|
| +
|
| "golang.org/x/net/context"
|
| )
|
|
|
| @@ -56,6 +57,11 @@ type Config struct {
|
| // Prefix is the log stream common prefix value.
|
| Prefix types.StreamName
|
|
|
| + // GlobalTags are a set of global log stream tags to apply to individual
|
| + // streams on registration. Individual stream tags will override tags with
|
| + // the same key.
|
| + GlobalTags streamproto.TagMap
|
| +
|
| // BufferLogs, if true, instructs the butler to buffer collected log data
|
| // before sending it to Output.
|
| BufferLogs bool
|
| @@ -398,6 +404,17 @@ func (b *Butler) AddStream(rc io.ReadCloser, p *streamproto.Properties) error {
|
| return err
|
| }
|
|
|
| + // Build per-stream tag map.
|
| + if l := len(b.c.GlobalTags); l > 0 {
|
| + for k, v := range b.c.GlobalTags {
|
| + // Add only global flags that aren't already present (overridden) in
|
| + // stream tags.
|
| + if _, ok := p.Tags[k]; !ok {
|
| + p.Tags[k] = v
|
| + }
|
| + }
|
| + }
|
| +
|
| if p.Timeout > 0 {
|
| if rts, ok := rc.(iotools.ReadTimeoutSetter); ok {
|
| if err := rts.SetReadTimeout(p.Timeout); err != nil {
|
|
|