Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-env-logger

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-env-logger

Angular service to facilitate logging based on environment.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

ng-env-logger — Angular Logging Service Package

How many times have you left a rogue console.log in your production code? That's the worst, right? This package will help keep that from occurring.

This package logs to the console by giving you multiple levels to write:

  1. error
  2. warn
  3. info
  4. debug
  5. log

When the service is initialized, you provide a level for it to write. So, for example, if you provide the WARN level (number 2), this.logService.info(), .debug(), and .log() calls are ignored; only the .warn() and .error() functions continue to work. This will allow you to log certain messages or objects in development without worrying about removing them for your production version of the app. Whichever level you choose, the service logs that number and lower to the console.

To use the service, add the following to your AppModule's imports array:

NgLogModule.forRoot({ level: LogLevels.WARN }),

To update the logging level, call the updateLogLevel function on the service and pass it a one of the above levels. The provided number does have to be between 1 and 5, which are the values that the enum LogLevels provides.

Keywords

FAQs

Package last updated on 05 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc