New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

argon-logger

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

argon-logger

Sample rollup app

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
202
decreased by-13.68%
Maintainers
1
Weekly downloads
 
Created
Source

Argon logger Build Status

Argon logger is a simple console logging utility with options to enable/disable logs as per given environment configuration. Argon logger extends the existing console API, therefore any changes to existing console object will reflect in argon logger too.

Installation

npm i argon-logger

How it works?

Argon logger is simple to use.

Without configuration

import Logger from 'argon-logger';

const logger = new Logger();

logger.log('Hello'); // -> Hello
logger.warn('This is a warning'); // -> This is a warning
logger.error('This is an error'); // -> This is an error
logger.debug('This is a debug message'); // -> This is a debug message
...

By default argon logger enables log statements for localhost URLs or URLs containing debug as a search parameter. We can change this behavior by providing a configuration.

With configuration

const logger = new Logger({
    allowedHostnames: ['google.com'], // List of hostnames allowed. Set this to an empty array to allow logs everywhere.
    allowedQueryStringParameters: ['debug=true'], // List of query string parameters for which logs should be generated.
    disable: false // If set to "true" disables the logging completely. The remaining two parameters are ignored.
});

logger.log('Hello'); // Hello
logger.warn('This is a warning'); // This is a warning
...

Disclaimer

Argon logger doesn't have any major releases yet. It means it has potential to break in few scenarios. We need your contribution to make it better. Please email at contactsachinsingh@gmail.com if you want to become a contributor.

FAQs

Package last updated on 14 Sep 2019

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