| 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 "os" | 8 "os" |
| 9 | 9 |
| 10 "github.com/luci/luci-go/client/internal/logdog/butler" | 10 "github.com/luci/luci-go/client/internal/logdog/butler" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 if err != nil { | 61 if err != nil { |
| 62 log.Fields{ | 62 log.Fields{ |
| 63 log.ErrorKey: err, | 63 log.ErrorKey: err, |
| 64 "path": cmd.path, | 64 "path": cmd.path, |
| 65 }.Errorf(a, "Failed to open input stream file.") | 65 }.Errorf(a, "Failed to open input stream file.") |
| 66 return runtimeErrorReturnCode | 66 return runtimeErrorReturnCode |
| 67 } | 67 } |
| 68 streamFile = file | 68 streamFile = file |
| 69 } | 69 } |
| 70 | 70 |
| 71 // We think everything should work. Configure our Output instance. |
| 72 output, err := a.configOutput() |
| 73 if err != nil { |
| 74 log.WithError(err).Errorf(a, "Failed to create output instance."
) |
| 75 return runtimeErrorReturnCode |
| 76 } |
| 77 defer output.Close() |
| 78 |
| 71 // Instantiate our Processor. | 79 // Instantiate our Processor. |
| 72 » err := a.Main(func(b *butler.Butler) error { | 80 » err = a.runWithButler(output, func(b *butler.Butler) error { |
| 73 if err := b.AddStream(streamFile, cmd.stream.properties()); err
!= nil { | 81 if err := b.AddStream(streamFile, cmd.stream.properties()); err
!= nil { |
| 74 return err | 82 return err |
| 75 } | 83 } |
| 76 | 84 |
| 77 b.Activate() | 85 b.Activate() |
| 78 return nil | 86 return nil |
| 79 }) | 87 }) |
| 80 if err != nil { | 88 if err != nil { |
| 81 log.Fields{ | 89 log.Fields{ |
| 82 log.ErrorKey: err, | 90 log.ErrorKey: err, |
| 83 }.Errorf(a, "Failed to stream file.") | 91 }.Errorf(a, "Failed to stream file.") |
| 84 return runtimeErrorReturnCode | 92 return runtimeErrorReturnCode |
| 85 } | 93 } |
| 86 | 94 |
| 87 return 0 | 95 return 0 |
| 88 } | 96 } |
| OLD | NEW |