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

Allow using your own logger #697

Open
Hannnes1 opened this issue Jul 2, 2024 · 0 comments
Open

Allow using your own logger #697

Hannnes1 opened this issue Jul 2, 2024 · 0 comments

Comments

@Hannnes1
Copy link

Hannnes1 commented Jul 2, 2024

This issue is based on an idea mentioned in #374.

EasyLocalization is currently tightly coupled to EasyLogger. This is an issue for apps that want to use a different logger, or want to log to something other than the console (for example Firebase Crashlytics or Sentry).

The only way around this limitation right now is to customize EasyLocalization.logger.printer, but that still relies on EasyLogger.

I suggest creating a callback parameter (e.g. onEvent) in EasyLocalization that by default passes the events to EasyLogger for compatibility. The internal easyLocalization code should then call this new onEvent parameter instead of EasyLocalization.logger; perhaps using some private helper function that is similar to the existing logging methods.

This approach would allow users to use any logging framework that they want, without having to go through EasyLogger.

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