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

A simple console logging utility

  • 0.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
767
increased by189.43%
Maintainers
1
Weekly downloads
 
Created
Source

Argon logger Build Status

Argon logger is a simple console utility with options to enable/disable logs for any environment. Argon logger extends the existing console API, there it works the same as console.log but with more control and flexibility. Additionally, it doesn't throw any linting error (unless someone decides to create a rule for logger.log 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.
    allowedPorts: [], // List of ports for which logging should be enabled
    test: () => { ... }, // A test function for full flexibility on customizing where to hide the logs
                         // A test function overrides existing filters.
    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.

Keywords

FAQs

Package last updated on 05 Mar 2020

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