Skip to content

Conversation

@sreenithi
Copy link

Changes to add Abseil logging support in gRPC Python hence resolving grpc/grpc#38703.

Implementation PR:

@sreenithi sreenithi self-assigned this Jul 4, 2025
Co-authored-by: Ashesh Vidyut <[email protected]>
Copy link
Member

@sergiitk sergiitk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed IRL.

Copy link
Member

@sergiitk sergiitk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but let's ask Mark to give this a look once the remaining feedback is addressed.

Comment on lines 33 to 35
> Note that if abseil fixes https://github.com/abseil/abseil-cpp/issues/1656,
> gRPC Core itself will be able to invoke absl::InitializeLog(), but until then
> this is a workaround.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the ticket - I don't think its point is to allow to "Core itself" .. "to invoke absl::InitializeLog()", but to "Make absl::InitializeLog safe to be called multiple times", making the call a no-op if already been called. We'll still have to call it from Cython.

I think we should remove this block.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed IRL, to be rephrased to make it clear the call may be moved to gRPC Core depending on how abseil/abseil-cpp#1656 is resoved.

[L117][L117].

After this change, gRPC python users started seeing the warning log -
`WARNING: All log messages before absl::InitializeLog() is called are written to STDERR`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we reproduce this? I was only able to get it printed with export GRPC_VERBOSITY=INFO (which also prints out Log level INFO is not suitable for production. Prefer WARNING or ERROR. However if you see this message in a debug environment or test environment it is safe to ignore this message., or with export GRPC_TRACE=connectivity_state (or any other module).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to reproduce by setting GRPC_VERBOSITY=debug

_initialize()
```

### Behaviour with multiple imports of gRPC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Behaviour with multiple imports of gRPC
### Behavior with multiple imports of gRPC

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is yet another Americal vs British English differences I suppose. I was using the British English spelling, however changed as suggested now :)

@sreenithi
Copy link
Author

sreenithi commented Nov 21, 2025

LGTM, but let's ask Mark to give this a look once the remaining feedback is addressed.

addressed the feedback. @markdroth PTAL and let us know your comments too before we open for public review.

@sreenithi sreenithi requested a review from markdroth November 24, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants