Nightly Procrastination Machine

    @everymundo/simple-logr

    2.2.4 • Public • Published

    @everymundo/simple-logr

    A very simplistic logger that allows one to avoid using the console.log directly allowing stubbing and better linting.

    It's just a simple wrapper around console./log|war|error/ with a few extra features.

    installation

    npm install @everymundo/simple-logr

    usage

    The environmental variable LOG_LEVEL can be used to change the log level for the logger. LOG_LEVEL default value is info. That means all your calls to logr.trace and logr.debug are not going to print anything out.

    Assuming you run the (simple-usage.js)[ls examples/simple-usage/simple-usage.js] script with the environmental variable LOG_LEVEL=trace, you can see the expected result.

    const logr = require('@everymundo/simple-logr');
    
    logr.trace('message'); // outputs: YYYY-MM-DDTHH:mm:ss.zzz TRACE: filename:lineNumber message
    logr.debug('message'); // outputs: YYYY-MM-DDTHH:mm:ss.zzz DEBUG: filename:lineNumber message
    logr.info('message');  // outputs: YYYY-MM-DDTHH:mm:ss.zzz INFO: message
    logr.warn('message');  // outputs: YYYY-MM-DDTHH:mm:ss.zzz WARN: message
    logr.error('message'); // outputs: YYYY-MM-DDTHH:mm:ss.zzz ERROR: message
    logr.fatal('message'); // outputs: YYYY-MM-DDTHH:mm:ss.zzz FATAL: message

    If you clone this repo you can run the above examples with the help of npm scripts. Here are the steps:

    git clone https://github.com/EveryMundo/simple-logr.git
    cd simple-logr/examples/simple-usage
    npm install
    
    npm run trace
    npm run debug
    npm run info
    npm run warn
    npm run error
    npm run fatal

    Keywords

    Install

    npm i @everymundo/simple-logr

    DownloadsWeekly Downloads

    14

    Version

    2.2.4

    License

    MIT

    Unpacked Size

    6.65 kB

    Total Files

    6

    Last publish

    Collaborators

    • mtmorell88
    • a11y_automation2
    • ramses83
    • raydel
    • alex-orga
    • vladimirpetrov
    • estebanpablo89
    • yartiles
    • jonmorazav
    • emdavidmoreno
    • everymundo-admin
    • ballester
    • danielsan
    • halain
    • avivero93
    • anahiem
    • herlin
    • karinfdez
    • ernestocarrasco
    • erlin
    • front10devs
    • hdelcastillo
    • dcuevacem
    • rodneyem
    • ortega.dc98
    • pedroleon917
    • kaylingw
    • joeaspiazuem
    • lazjramos
    • daniuska-em
    • cstansfld