1.3.0 • Published 8 years ago

eelog v1.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

eelog

eelog is a zero dependency, middleware based logging library for node.js and the browser

usage

import Eelog from 'eelog';

function saveToMongoDb(loggedData, next) {
    /**
     * expect loggedData to be an object
     * eg. {
                level:'info',
                'message': 'this is a log',
                'timestamp': '2016-02-29T07:58:22.339Z',
            }
     */

    mongo.insert(loggedData).then(() => {
        next() // call the next middleware
    }).then((err) => {
        // catch it
    });
}

let options = {
    console:true, // toggle logging to console
}

let log = new Eelog(options);

// register saveToMongoDb middleware
log.use(saveToMongoDb)

// now we can start logging
log.info('this is a log');
log.info('this is a log with %s and %s', 1, 48);
log.info({data:'foo'}, 'this is a log with data:foo and %s %s', 1, 48);
1.3.0

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago