Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
/ log Public archive

Consistent console logging for our CLI apps.

License

Notifications You must be signed in to change notification settings

gridonic/log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Consistent console logging for our CLI apps.


Installation

Very simple. Just run $ npm install @gridonic/log.


How to use?

Examples say more than a thousand words.

const { info, error, success, warning } = require('@gridonic/log');

try {
    info('Starting my app…');
    
    if (specialCondition() === true) {
        warning('Please pay attention to this.');
    }
    
    // Make sure success message has enough blank space before it
    success('Everything done.', 0, 3);
} catch(myBadError) {
    error(myBadError);
}

You may also use the second (newlineAfter) and third (newlineBefore) parameter for adding newlines.

gridonic.chgridonic.github.io@gridonic