| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |