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

Adding a proper Dart logger to track events when a request is sent by the client app #13

Open
anasfik opened this issue Jan 23, 2023 · 0 comments

Comments

@anasfik
Copy link

anasfik commented Jan 23, 2023

Hi,
in many cases in the SDK, there should be some way to give the developer the ability to track and know where exactly something went wrong if an error is thrown, like when sending the request to the Rest API, when a failure or success happens in an internal asynchronous method of the SDK, as an example if the developer did put a wrong public key, or if there is some server ( statusCode 500 ) error, the method call will fail, not all methods are covered with throwing an exception, so the result will be a complete silence for the developer, not knowing what exactly goes wrong.

A logger using dart;developer's log() method will absolutely be helpful in tracking the process, this could be an example of the target result:

// ! Debug Console
// [ YCPay ] Public key and is set.
// [ YCPay ] Card information of CUSTOMER NAME is initialized.
// [ YCPay ] Payment with the card is ready to use.
// [ YCPay ] Starting payment request to the server.
// ...

and so on, the same thing for triggering errors, as an example if the developer did set a publish key that is invalid ( doesn't meet your key generation criteria ), an error log will inform him:

// [ YCPay ] Public key is invalid.

I hope you get the target expectation.

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

No branches or pull requests

1 participant