# em-logr

> Bunyan/Pino Logger instance ready to use

Latest version **1.2.3** (published 2019-08-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install em-logr
pnpm add em-logr
yarn add em-logr
bun add em-logr
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2019-08-13 |
| First published | 2017-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniel Santana |
| Maintainers | danielsan |
| Keywords | bunyan, pino, everymundo, logger |

## Links

- npm: https://www.npmjs.com/package/em-logr
- Repository: https://github.com/EveryMundo/em-logr
- Homepage: https://github.com/EveryMundo/em-logr#readme
- Issues: https://github.com/EveryMundo/em-logr/issues
- npm.io page: https://npm.io/package/em-logr

## Dependencies (2)

- [pino](https://npm.io/package/pino.md) ^5.13.2
- [bunyan](https://npm.io/package/bunyan.md) ^1.8.12

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.2.3 (latest) — 2019-08-13
- 1.2.2 — 2019-07-08
- 1.2.1 — 2019-03-28
- 1.2.0 — 2017-05-06
- 1.1.2 — 2017-04-24
- 1.1.1 — 2017-04-24

## README

# logr
Bunyan / Pino Logger instance ready to use

Bunyan is really great for debugging purposes but Pino is crazily fast.

Thinking about that this package was created to use Bunyan whenever the
LOG_LEVEL environmental variable is set to ```debug``` or ```trace```;

## INSTALL

    npm install em-loger --save

## Config

Logr will use [bunyan][1] if the **LOG_LEVEL** environmental variable has the values *trace* or *debug*
and it will also enable the **src** option of bunyan automatically, which displays the filename along
side with the line number on each log message.

Using **LOG_LEVEL** environmental variable with the values *info*, *warn* or *trace* will load
[pinojs][2] which is faster and has a very similar api.

## USAGE
```javascript
    const logr = require('em-logr');
    
    logr.trace('My trace message');
    logr.debug('My debug message');
    logr.info('My info message');
    logr.warn('My warn message')
    logr.error('My error message');
```
Child loggers
```javascript
    const
      _1stChildLogr = require('em-logr').child({name:'1stChild'}),
      _2ndChildLogr = require('em-logr').child({name:'2ndChild'});

    _1stChildLogr.info("The remote is mine, I am the first born child");
    _2ndChildLogr.info("The remote is mine, Mom likes me better");
    _1stChildLogr.warn("Get out of here or I'll hit you in the face!");
    _2ndChildLogr.info("Do not touch me or I'll tell mom to know about  secret.");
    _1stChildLogr.error("I did' see that coming!");
```

[1]: https://github.com/trentm/node-bunyan
[2]: https://github.com/pinojs/pino

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