You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by GitBox <gi...@apache.org> on 2020/10/19 10:36:03 UTC

[GitHub] [thrift] dcelasun commented on a change in pull request #2261: Add Dump protocol to go's TDebugProtocol

dcelasun commented on a change in pull request #2261:
URL: https://github.com/apache/thrift/pull/2261#discussion_r507643633



##########
File path: lib/go/thrift/debug_protocol.go
##########
@@ -25,9 +25,27 @@ import (
 )
 
 type TDebugProtocol struct {
-	Delegate  TProtocol
-	LogPrefix string
+	// Required. The actual TProtocol to do the read/write.
+	Delegate TProtocol
+
+	// Optional. The logger and prefix to log all the args/return values
+	// from Delegate TProtocol calls.
+	//
+	// If Logger is nil, StdLogger using stdlib log package with os.Stderr
+	// will be used. If disable logging is desired, set Logger to NopLogger
+	// explicitly instead of leaving it as nil/unset.
 	Logger    Logger
+	LogPrefix string
+
+	// Optional. An TProtocol to dump everything read/wrote from Delegate.
+	//
+	// A typical use case of this is to use TSimpleJSONProtocol wrapping
+	// TMemoryBuffer in a middleware to json logging requests/responses.
+	//
+	// This feature is not available from TDebugProtocolFactory. In order to
+	// use it you have to construct TDebugProtocol directly, or set Dump
+	// field after getting a TDebugProtocol from the factory.
+	Dump TProtocol

Review comment:
       Hmm, "Export"? "Intercept"?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org