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

Unified Diff: client/cmd/logdog_butler/output.go

Issue 1975683002: LogDog: Implement prefix registration in Butler. (Closed) Base URL: https://github.com/luci/luci-go@logdog-butler-register-collector
Patch Set: Rebarse Created 4 years, 7 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 | « client/cmd/logdog_butler/main.go ('k') | client/cmd/logdog_butler/output_log.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/cmd/logdog_butler/output.go
diff --git a/client/cmd/logdog_butler/output.go b/client/cmd/logdog_butler/output.go
index 9d896a58619007db70999bd50a759803597c3416..7c5911788d7d61b689e4a103115ead7832ba3f5f 100644
--- a/client/cmd/logdog_butler/output.go
+++ b/client/cmd/logdog_butler/output.go
@@ -5,6 +5,8 @@
package main
import (
+ "sort"
+
"github.com/luci/luci-go/client/internal/logdog/butler/output"
"github.com/luci/luci-go/common/flag/multiflag"
)
@@ -12,6 +14,7 @@ import (
type outputFactory interface {
option() multiflag.Option
configOutput(a *application) (output.Output, error)
+ scopes() []string
}
// outputConfigFlag instance that produces a MessageOutput instance when run.
@@ -70,3 +73,19 @@ func registerOutputFactory(f outputFactory) {
func getOutputFactories() []outputFactory {
return outputFactories
}
+
+func allOutputScopes() []string {
+ scopes := make(map[string]struct{})
+ for _, of := range outputFactories {
+ for _, scope := range of.scopes() {
+ scopes[scope] = struct{}{}
+ }
+ }
+
+ allScopes := make([]string, 0, len(scopes))
+ for scope := range scopes {
+ allScopes = append(allScopes, scope)
+ }
+ sort.Strings(allScopes)
+ return allScopes
+}
« no previous file with comments | « client/cmd/logdog_butler/main.go ('k') | client/cmd/logdog_butler/output_log.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698