fishy commented on code in PR #2882:
URL: https://github.com/apache/thrift/pull/2882#discussion_r1397954268


##########
lib/go/thrift/simple_server.go:
##########
@@ -179,8 +179,18 @@ func (p *TSimpleServer) SetForwardHeaders(headers 
[]string) {
 //
 // If no logger was set before Serve is called, a default logger using standard
 // log library will be used.
-func (p *TSimpleServer) SetLogger(logger Logger) {
-       p.logger = logger
+//
+// Deprecated: The logging inside TSimpleServer is now done via slog on error
+// level, this does nothing now. It will be removed in a future version.
+func (p *TSimpleServer) SetLogger(_ Logger) {}
+
+// SetLogContext sets the context to be used when logging errors inside
+// TSimpleServer.
+//
+// If this is not called before calling Serve, context.Background() will be
+// used.
+func (p *TSimpleServer) SetLogContext(ctx context.Context) {

Review Comment:
   note: I used the term `LogContext` over `BaseContext` here as I intend this 
context to only be used for logging.
   
   if we use it as base context to create ctx that we pass into processors and 
eventually handlers, then whatever developers set on the ctx to control the 
logging of TSimpleServer will also end up in their service handlers, which is 
most likely not intended and could be a big surprise.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to