Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a gRPC logger #214

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add a gRPC logger #214

wants to merge 3 commits into from

Conversation

JPFrancoia
Copy link

As discussed in this issue: #201 (comment).

This PR adds a gRPC logger. This logger was inspired by the http logger and works very similarly. The logger can be used to instrument a gRPC client, allowing to transparently log gRPC calls.
The logger obfuscates authorization tokens by default (I find it really insecure to write tokens to the logs), but this can be disabled if needs be.
For now, it only supports unary RPCs, but adding streaming RPCs shouldn't be too difficult.

@JPFrancoia
Copy link
Author

Thanks! I don't have merge power on this repo though, someone with permission needs to merge

Copy link
Owner

@Frezyx Frezyx left a comment

Choose a reason for hiding this comment

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

Hello @JPFrancoia !
Thank you so much for taking the time to contribute ❤️
I will merge this changes after review fix

Comment on lines 59 to 60
class GrpcRequestLog<Q, R> extends TalkerLog {
GrpcRequestLog(
Copy link
Owner

Choose a reason for hiding this comment

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

Can we move logs classes in different file like in talker_bloc_logger package ?

Copy link
Author

Choose a reason for hiding this comment

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

done, moved to grpc_logs.dart

Comment on lines 177 to 178
@override
AnsiPen get pen => (AnsiPen()..xterm(219));
Copy link
Owner

Choose a reason for hiding this comment

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

Please replace response log color with green like in talker_dio_logger

Copy link
Author

Choose a reason for hiding this comment

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

done

Comment on lines 127 to 128
@override
AnsiPen get pen => (AnsiPen()..xterm(219));
Copy link
Owner

Choose a reason for hiding this comment

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

Please replace error log color with red like in talker_dio_logger

Copy link
Author

Choose a reason for hiding this comment

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

Done

@JPFrancoia
Copy link
Author

All comments addressed!

@JPFrancoia JPFrancoia requested a review from Frezyx May 4, 2024 09:44
@Frezyx Frezyx linked an issue May 27, 2024 that may be closed by this pull request
@Frezyx Frezyx added work_in_progress Сurrently under work enhancement New feature or request labels May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request work_in_progress Сurrently under work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creation of a gRPC logger
3 participants