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

Side by Side Diff: logdog/client/cmd/logdog_butler/subcommand_serve.go

Issue 2456673003: Butler: export Coordinator host in environment. (Closed)
Patch Set: Relieve suspense. Created 4 years, 1 month 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 LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 log "github.com/luci/luci-go/common/logging" 8 log "github.com/luci/luci-go/common/logging"
9 "github.com/luci/luci-go/logdog/client/butler" 9 "github.com/luci/luci-go/logdog/client/butler"
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 return configErrorReturnCode 42 return configErrorReturnCode
43 } 43 }
44 streamServer := createStreamServer(a, cmd.uri) 44 streamServer := createStreamServer(a, cmd.uri)
45 45
46 if err := streamServer.Listen(); err != nil { 46 if err := streamServer.Listen(); err != nil {
47 log.Errorf(log.SetError(a, err), "Failed to connect to stream se rver.") 47 log.Errorf(log.SetError(a, err), "Failed to connect to stream se rver.")
48 return runtimeErrorReturnCode 48 return runtimeErrorReturnCode
49 } 49 }
50 50
51 // We think everything will work. Configure our Output instance. 51 // We think everything will work. Configure our Output instance.
52 » output, err := a.configOutput() 52 » of, err := a.getOutputFactory()
53 » if err != nil {
54 » » log.WithError(err).Errorf(a, "Failed to get output factory insta nce.")
55 » » return runtimeErrorReturnCode
56 » }
57 » output, err := of.configOutput(a)
53 if err != nil { 58 if err != nil {
54 log.WithError(err).Errorf(a, "Failed to create output instance." ) 59 log.WithError(err).Errorf(a, "Failed to create output instance." )
55 return runtimeErrorReturnCode 60 return runtimeErrorReturnCode
56 } 61 }
57 defer output.Close() 62 defer output.Close()
58 63
59 err = a.runWithButler(a, output, func(ctx context.Context, b *butler.But ler) error { 64 err = a.runWithButler(a, output, func(ctx context.Context, b *butler.But ler) error {
60 b.AddStreamServer(streamServer) 65 b.AddStreamServer(streamServer)
61 return b.Wait() 66 return b.Wait()
62 }) 67 })
63 if err != nil { 68 if err != nil {
64 logAnnotatedErr(a, err, "Failed to serve.") 69 logAnnotatedErr(a, err, "Failed to serve.")
65 return runtimeErrorReturnCode 70 return runtimeErrorReturnCode
66 } 71 }
67 72
68 return 0 73 return 0
69 } 74 }
OLDNEW
« no previous file with comments | « logdog/client/cmd/logdog_butler/subcommand_run.go ('k') | logdog/client/cmd/logdog_butler/subcommand_stream.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698