# eelog

> a middleware based logging library for node and the browser

Latest version **1.3.0** (published 2018-03-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install eelog
pnpm add eelog
yarn add eelog
bun add eelog
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2018-03-22 |
| First published | 2016-02-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alloys Mila |
| Maintainers | mofax |

## Links

- npm: https://www.npmjs.com/package/eelog
- Repository: https://github.com/mofax/eelog
- Homepage: https://github.com/mofax/eelog#readme
- Issues: https://github.com/mofax/eelog/issues
- npm.io page: https://npm.io/package/eelog

## Recent versions

- 1.3.0 (latest) — 2018-03-22
- 1.2.2 — 2018-01-09
- 1.2.1 — 2018-01-09
- 1.2.0 — 2017-11-30
- 1.1.0 — 2016-05-24
- 1.0.1 — 2016-05-17
- 1.0.0 — 2016-05-12
- 0.0.7 — 2016-04-07
- 0.0.6 — 2016-03-03
- 0.0.5 — 2016-02-29
- 0.0.4 — 2016-02-29
- 0.0.3 — 2016-02-29
- 0.0.2 — 2016-02-29
- 0.0.1 — 2016-02-27
- 0.0.0 — 2016-02-27

## README

# eelog

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

## usage
```javascript
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);
```

---
_Source: https://npm.io/package/eelog · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
