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

Side by Side Diff: client/cmd/logdog_butler/subcommand_serve.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, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "github.com/luci/luci-go/client/internal/logdog/butler" 8 "github.com/luci/luci-go/client/internal/logdog/butler"
9 log "github.com/luci/luci-go/common/logging" 9 log "github.com/luci/luci-go/common/logging"
10 "github.com/maruel/subcommands" 10 "github.com/maruel/subcommands"
(...skipping 28 matching lines...) Expand all
39 }.Errorf(a, "Invalid stream server URI.") 39 }.Errorf(a, "Invalid stream server URI.")
40 return configErrorReturnCode 40 return configErrorReturnCode
41 } 41 }
42 streamServer := createStreamServer(a, cmd.uri) 42 streamServer := createStreamServer(a, cmd.uri)
43 43
44 if err := streamServer.Listen(); err != nil { 44 if err := streamServer.Listen(); err != nil {
45 log.Errorf(log.SetError(a, err), "Failed to connect to stream se rver.") 45 log.Errorf(log.SetError(a, err), "Failed to connect to stream se rver.")
46 return runtimeErrorReturnCode 46 return runtimeErrorReturnCode
47 } 47 }
48 48
49 » a.Main(func(b *butler.Butler) error { 49 » // We think everything will work. Configure our Output instance.
50 » output, err := a.configOutput()
51 » if err != nil {
52 » » log.WithError(err).Errorf(a, "Failed to create output instance." )
53 » » return runtimeErrorReturnCode
54 » }
55 » defer output.Close()
56
57 » a.runWithButler(output, func(b *butler.Butler) error {
50 b.AddStreamServer(streamServer) 58 b.AddStreamServer(streamServer)
51 return nil 59 return nil
52 }) 60 })
53 61
54 return 0 62 return 0
55 } 63 }
OLDNEW
« no previous file with comments | « client/cmd/logdog_butler/subcommand_run.go ('k') | client/cmd/logdog_butler/subcommand_stream.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698