Sync in latest go-plugin

This commit is contained in:
Jeff Mitchell 2018-01-17 11:57:17 -05:00
parent 982c1aa972
commit bb45c06371
2 changed files with 16 additions and 9 deletions

View File

@ -66,6 +66,10 @@ type ServeConfig struct {
// the gRPC health checking service. This is not optional since go-plugin
// relies on this to implement Ping().
GRPCServer func([]grpc.ServerOption) *grpc.Server
// Logger is used to pass a logger into the server. If none is provided the
// server will create a default logger.
Logger hclog.Logger
}
// Protocol returns the protocol that this server should speak.
@ -106,12 +110,15 @@ func Serve(opts *ServeConfig) {
// Logging goes to the original stderr
log.SetOutput(os.Stderr)
// internal logger to os.Stderr
logger := hclog.New(&hclog.LoggerOptions{
Level: hclog.Trace,
Output: os.Stderr,
JSONFormat: true,
})
logger := opts.Logger
if logger == nil {
// internal logger to os.Stderr
logger = hclog.New(&hclog.LoggerOptions{
Level: hclog.Trace,
Output: os.Stderr,
JSONFormat: true,
})
}
// Create our new stdout, stderr files. These will override our built-in
// stdout/stderr so that it works across the stream boundary.

6
vendor/vendor.json vendored
View File

@ -1021,10 +1021,10 @@
"revisionTime": "2017-06-22T06:09:55Z"
},
{
"checksumSHA1": "tFCvjFzOo0x4P2SEzj8UazxTMug=",
"checksumSHA1": "QSH/KjHRLljyZDXMmkd9fdqbr3I=",
"path": "github.com/hashicorp/go-plugin",
"revision": "e2fbc6864d18d3c37b6cde4297ec9fca266d28f1",
"revisionTime": "2017-10-29T21:44:25Z"
"revision": "e37881a3f1a07fce82b3d99ce0342a72e53386bc",
"revisionTime": "2018-01-11T18:21:30Z"
},
{
"checksumSHA1": "yzoWV7yrS/TvOrKy5ZrdUjsYaOA=",