npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

yt-angular-logger

v1.0.2

Published

This is useful to log your error/info/warning etc. on console, localstorage and server.

Downloads

1

Readme

yt-angular-logger

This is useful to log your error/info/warning etc. on console, localstorage and server.

How to integrate

Steps: 1. Run "npm i yt-angular-logger" in your angular project. 2. Import it in appModule like: "import { LogModule, LogPublisherConfig } from 'yt-angular-logger'"; 3. Create a configuration variable of LogPublisherConfig class and add it in appmodule.ts file. Set isActive property true/false according to wherever you want to log the content i.e.

            const logConfig: LogPublisherConfig[] = [
                    {
                        "loggerName": "console",
                        "loggerLocation": "",
                        "isActive": true
                    },
                    {
                        "loggerName": "localstorage",
                        "loggerLocation": "logging",
                        "isActive": false
                    },
                    {
                        "loggerName": "webapi",
                        "loggerLocation": "YourDomainName/api/log",
                        "isActive": false
                    }];
                    
4. Replace "YourDomainName/api/log" with your endpoint when you want to log content on server.
5. Use LogModule in your NgModule's Import i.e. 

    LogModule.forRoot(logConfig)              

6. To use it, import LogService in your component. This service will expose all logging functions i.e.

    import { LogService } from 'yt-angular-logger';

7. Add service in your constructor and use it i.e.
    
    constructor(private _LogService: LogService) {
        this._LogService.log('log message from component', { LogObject: 12345 }, "LogText",...more parameters if you want to supply);
        }

#Changes in Version # 1.0.1 Readme file content is updated to guild that how can we implement it. # 1.0.2 A few internal changes made to handle errors.