New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@comodinx/logger

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@comodinx/logger

Logger is a Node.js logger helper based on winston.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Logger

@comodinx/logger is a Node.js logger helper based on winston.

Index

  • Download & Install.
  • How is it used?.
  • Tests.

Download & Install

NPM

    npm install @comodinx/logger

Source code

$ git clone https://gitlab.com/comodinx/logger.git
$ cd logger
$ npm install

How is it used?

Configure

Environment variableValuesTypeDefault value
LOGGER_ENABLEDtrue/falsebooleantrue
LOGGER_SILENTtrue/falsebooleanfalse
LOGGER_LEVELhttp,info,warn or errorstringhttp
LOGGER_FORMATsimple,json or combinestringcombine
LOGGER_TRANSPORTSconsole,string list (,)console
file,
file:<filepath>:<log level>,
stream:<filepath>,
http:<host>:<port>:<path>:<auth>:<ssl>

Examples,

LOGGER_TRANSPORTS=console,file:.access.log,file:.errors.log:error

Logger

const logger = require('@comodinx/logger');

logger.error(new Error('Not Found')); // [2020-01-28T17:16:50.379Z] - ERROR - ✘ Ooops... Error: Not Found
logger.error('This is an error');     // [2020-01-28T17:16:50.379Z] - ERROR - ✘ Ooops... This is an error
logger.warn('This is a warning');     // [2020-01-28T17:16:50.381Z] - WARN - ⚠ This is a warning
logger.info('Hello World!');          // [2020-01-28T17:16:50.381Z] - INFO - Hello World!
logger.title('Hello World!');         // [2020-01-28T17:16:50.382Z] - INFO - ==========   Hello World!   ==========
logger.success('Hello World!');       // [2020-01-28T17:16:50.383Z] - INFO - ✔ Hello World!
logger.arrow('Hello World!');         // [2020-01-28T17:16:50.384Z] - INFO - • Hello World!
logger.step('Hello World!');          // [2020-01-28T17:16:50.384Z] - INFO - ✦ Hello World!
logger.lap('Hello World!');           // [2020-01-28T17:16:50.384Z] - INFO - ➜ Hello World!

Tests

In order to see more concrete examples, I INVITE YOU TO LOOK AT THE TESTS :)

Run the unit tests

npm test

Keywords

log

FAQs

Package last updated on 05 Apr 2021

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