-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
base: master
Are you sure you want to change the base?
Add a gRPC logger #214
Conversation
Thanks! I don't have merge power on this repo though, someone with permission needs to merge |
There was a problem hiding this 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
class GrpcRequestLog<Q, R> extends TalkerLog { | ||
GrpcRequestLog( |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
@override | ||
AnsiPen get pen => (AnsiPen()..xterm(219)); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@override | ||
AnsiPen get pen => (AnsiPen()..xterm(219)); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
changing the color of some log messages.
All comments addressed! |
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.