From bb45c063711817f61b3dae009e27724d75f2818c Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Wed, 17 Jan 2018 11:57:17 -0500 Subject: [PATCH] Sync in latest go-plugin --- .../github.com/hashicorp/go-plugin/server.go | 19 +++++++++++++------ vendor/vendor.json | 6 +++--- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/vendor/github.com/hashicorp/go-plugin/server.go b/vendor/github.com/hashicorp/go-plugin/server.go index e1543214a5..1e808b99e3 100644 --- a/vendor/github.com/hashicorp/go-plugin/server.go +++ b/vendor/github.com/hashicorp/go-plugin/server.go @@ -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. diff --git a/vendor/vendor.json b/vendor/vendor.json index 21d05af27b..2dfdfd37c6 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -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=",