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

@paralect/common-logger

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paralect/common-logger

Simple, preconfigured logger

  • 0.1.10
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
213
increased by29.09%
Maintainers
1
Weekly downloads
 
Created
Source

Common Logger

Common logger is preconfigured console based logger. Currently based on winston.

Installation

npm i @paralect/common-logger

Usage

Create logger.js file in the root of your project:

const createConsoleLogger = require('@paralect/common-logger').createConsoleLogger;

module.exports = createConsoleLogger({ isDev: true });

By default isDev is set to false in logger. If set to true, two things will happen:

  1. All logs output will be in plain text (vs json for production like environments)
  2. For development environment logger will also output all logger.debug() messages, while none dev info and above.

Expose logger as global object

Since logger is such a common thing, it make sense to expose it as global variable, so it simpler to use it across the project.

global.logger = require('./logger');

// In a place, where you need logger:
const logger = global.logger;

FAQs

Package last updated on 30 Jul 2017

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