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

Subscribe to Logger Methods #310

Open
maks-humeniuk opened this issue Sep 5, 2022 · 2 comments
Open

Subscribe to Logger Methods #310

maks-humeniuk opened this issue Sep 5, 2022 · 2 comments
Labels
enhancement feature request A potential new feature is discussed

Comments

@maks-humeniuk
Copy link

maks-humeniuk commented Sep 5, 2022

I have some cases in my app, where I need to do something like this:

this.logger.info('Redirecting to remote...');
location.href = 'https://path/to/remote';

Obviously, log request is getting canceled, because calling document is destroyed before it completes.

So, it'd be great to be able to subscribe to logger methods like this:

this.logger.info('Redirecting to remote...').subscribe((): void => {
  location.href = 'https://path/to/remote';
});

or

this.logger.info('Redirecting to remote...').then((): void => {
  location.href = 'https://path/to/remote';
});
@bmtheo bmtheo added enhancement feature request A potential new feature is discussed labels Sep 12, 2022
@bmtheo
Copy link
Collaborator

bmtheo commented Sep 12, 2022

Yes indeed

This would require some thinking whether we include the API request in this or not

@maks-humeniuk
Copy link
Author

Hi. Did you find this reasonable to add to the library? My log requests are still not sent due to redirects 😅.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature request A potential new feature is discussed
Projects
None yet
Development

No branches or pull requests

2 participants