If you don't have yarn installed, install it globally:
npminstall--globalyarn
Examples
The library is really easy to work with, simply import it and use your Stream and Project API keys
Track errors globally
Angular provides a way to handle errors globally using Angular's ErrorHandler service. Here's an example of how you can set up global error handling in your Angular application:
Create a new class that implements the Angular ErrorHandler interface:
Now any unhandled errors that occur in your application will be caught by the GlobalErrorHandler class. You can customize the handleError method to log errors to send them to our remote logging infrastructure.
That's it! Now any unhandled errors that occur in your Angular application will be caught by the GlobalErrorHandler class and can be handled as needed.
Add logs to every piece of your Angular application
You can use LogsHQ built-in logging service called LogsHQLogger. The Logger service provides a way to log messages with different levels such as debug, info, warn, and error. Here's an example of how to use the LogsHQLogger service to add logs to every piece of your Angular application:
Use the LogsHQLogger service in your component, service, or any other class where you want to add logs. You can inject the Logger service into your constructor and use it to log messages:
That's it! With the LogsHQLogger service, you can easily add logs to every piece of your Angular application and customize the level of messages to log.