Skip to content

Latest commit

 

History

History
101 lines (68 loc) · 1.66 KB

README.md

File metadata and controls

101 lines (68 loc) · 1.66 KB

LOGI

Module for logging in your node environment.

Build Status

How To Use

Install it

npm install --save-dev https://github.com/Donmclean/logi

Require it

const logi = require('logi')();

Require it with options

const options = {format: 'gulp'} // *See OPTIONS for more*

const logi = require('logi')(options);

API

Essential logging

//BASIC LOG
logi.log('BASIC LOG');`

//WARNING LOG
logi.warning('WARNING LOG');

//ERROR LOG
logi.error('ERROR LOG');

//SUCCESS LOG
logi.success('SUCCESS LOG');

//INFO LOG
logi.info('INFO LOG');

Customized Logging

logi.mixed() utilizes the main features of chalk js in an attempt to simplify the logging experience.

Example 1

pass in an array of objects in this format

options = [{
    color: 'black',
    bgColor: 'bgWhite',
    modifier: ['strikethrough'],
    value: "this is a test 1"
},
{
    color: 'black',
    bgColor: 'bgWhite',
    modifier: ['italic'],
    value: "this is a test 2"
}];

logi.mixed(options);

result:

this is a test 1 this is a test 2

Example 2

value is the only required parameter in the options object

options = [{value: "basic log"}]
logi.mixed(options);

result: basic log

options = [{value: "basic log"},{value: "multiple values on same line"}]
logi.mixed(options);

result: basic log multiple values on same line

OPTIONS

format Type: string Default: 'default' Example: {format: 'gulp'}

list of possible formatting options are: 'default' 'gulp'