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

can bring your own errorHandler class #161

Merged
merged 1 commit into from
Dec 1, 2023
Merged

Conversation

Ppito
Copy link
Contributor

@Ppito Ppito commented Nov 30, 2023

Hello,

I implemented my own logs grouping system (I will be another contribution about that later), but I'm stock by the errorHandler which cannot be override, so the three Object (TalkerError, TalkerException and TalkerLog) that are created are on it, cannot be override too.

Now, if I want to override this part of the fonctionnality, I need to reimplemente many thing (_oberver, _handleErrorData, _talkerStreamController, ...), which is a lot of work for very little thing.

@Frezyx
Copy link
Owner

Frezyx commented Dec 1, 2023

Hello @Ppito !
This field was open to injection in previously versions, but I removed ability to change ErrorHandler in constructor because it was never used.
Now if your logs groping package needs it LGMT 👍🏻

@Ppito
Copy link
Contributor Author

Ppito commented Dec 1, 2023

Hello @Frezyx ,

For my implementation, I needed to add a Type field on all object model (TalkerLog, TalkerError, TalkerException, DioRequestLog, DioResponseLog, DioErrorLog) then I override all basics method (like log, info, warning, error...) and used logTyped to create my custom log. Now everything works has I wanted, except for the object that was created inside the errorHandler. :/

@Frezyx
Copy link
Owner

Frezyx commented Dec 1, 2023

Hello @Frezyx ,

For my implementation, I needed to add a Type field on all object model (TalkerLog, TalkerError, TalkerException, DioRequestLog, DioResponseLog, DioErrorLog) then I override all basics method (like log, info, warning, error...) and used logTyped to create my custom log. Now everything works has I wanted, except for the object that was created inside the errorHandler. :/

This looks like what I'm working on in pull request for 4 version of the library
#156

@Frezyx Frezyx merged commit c7cc472 into Frezyx:master Dec 1, 2023
1 check passed
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.

2 participants