Skip to content

Commit

Permalink
Expose disableInfoLogging method in Python
Browse files Browse the repository at this point in the history
Summary:
Similar as previous diff

> This diff solves the problem of extra log spew from Thrift Server in Meta's CLI tools, such as jk.

but for Python

Differential Revision: D57563914

fbshipit-source-id: 824dae115fff5ca1f819bace9340f0a9a2c26d79
  • Loading branch information
jermenkoo authored and facebook-github-bot committed May 21, 2024
1 parent 68420cf commit 71e9eb0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions thrift/lib/py3/server.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ cdef extern from "thrift/lib/cpp2/server/ThriftServer.h" \
cbool getQuickExitOnShutdownTimeout()
void setQuickExitOnShutdownTimeout(cbool quickExitOnShutdownTimeout)
void addRoutingHandler(unique_ptr[cTransportRoutingHandler])
void disableInfoLogging()

cdef extern from "folly/ssl/OpenSSLCertUtils.h" \
namespace "folly::ssl":
Expand Down
1 change: 1 addition & 0 deletions thrift/lib/py3/server.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class ThriftServer:
def set_quick_exit_on_shutdown_timeout(
self, quick_exit_on_shutdown_timeout: bool
) -> None: ...
def disable_info_logging(self) -> None: ...

class ReadHeaders(Headers): ...
class WriteHeaders(Headers): ...
Expand Down
3 changes: 3 additions & 0 deletions thrift/lib/py3/server.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ cdef class ThriftServer:
cdef void add_routing_handler(self, unique_ptr[cTransportRoutingHandler] handler):
self.server.get().addRoutingHandler(cmove(handler))

def disable_info_logging(self):
self.server.get().disableInfoLogging()

cdef class ClientMetadata:
@staticmethod
cdef ClientMetadata _fbthrift_create(optional[ClientMetadataRef] metadata_ref):
Expand Down

0 comments on commit 71e9eb0

Please sign in to comment.