Backend Plugins: Discard logged messages from logger named stdio (#23601)

Discard logged messages coming from backend plugin logger named 
stdio since that service is not in use. 

Fixes #23461
This commit is contained in:
Marcus Efraimsson 2020-04-16 13:08:07 +02:00 committed by GitHub
parent 7fc9921be3
commit ed51ce3ae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,7 +60,16 @@ func (lw logWrapper) With(args ...interface{}) hclog.Logger {
return logWrapper{Logger: lw.Logger.New(args...)}
}
func (lw logWrapper) Named(name string) hclog.Logger {
return logWrapper{Logger: lw.Logger.New()}
if name == "stdio" {
// discard logs from stdio hashicorp/go-plugin gRPC service since
// it's not enabled/in use per default.
// discard debug log of "waiting for stdio data".
// discard warn log of "received EOF, stopping recv loop".
return hclog.NewNullLogger()
}
return logWrapper{
Logger: lw.Logger.New(),
}
}
func (lw logWrapper) ResetNamed(name string) hclog.Logger {