# @janiscommerce/logger

> logger module allows you to leave message on console with optional data

Latest version **1.1.0** (published 2019-05-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install @janiscommerce/logger
pnpm add @janiscommerce/logger
yarn add @janiscommerce/logger
bun add @janiscommerce/logger
```

## 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.1.0 |
| Published | 2019-05-14 |
| First published | 2019-05-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Janis |
| Maintainers | janiscommerce |

## Links

- npm: https://www.npmjs.com/package/@janiscommerce/logger
- Repository: https://github.com/janis-commerce/logger
- Homepage: https://github.com/janis-commerce/logger#readme
- Issues: https://github.com/janis-commerce/logger/issues
- npm.io page: https://npm.io/package/@janiscommerce/logger

## Dependencies (3)

- [winston](https://npm.io/package/winston.md) ^3.2.1
- [cli-color](https://npm.io/package/cli-color.md) ^1.4.0
- [winston-transport](https://npm.io/package/winston-transport.md) ^4.3.0

## Recent versions

- 1.1.0 (latest) — 2019-05-14
- 1.0.2 — 2019-05-07
- 1.0.1 — 2019-05-07
- 1.0.0 — 2019-05-07

## README

# Logger

The `logger` module allows you to leave message on console with optional data.
The messages will appear with a level informed.
The levels are:
 - error
 - warn
 - deprecated
 - info
 - debug

In case of having the environment variable `TEST_ENV` with a truthy value, the logger will be in `silent` mode.

## Installation

```
npm install @janiscommerce/logger
```

## Usage

```js
const logger = require('@janiscommerce/logger');

logger.info('a great message');
// expected output: [2019-05-14T15:51:25.622Z][PID=1929][INFO]: a great message

const foo = 'bar';
logger.info('a great message with data', foo);
// expected output: [2019-05-14T15:51:25.623Z][PID=1929][INFO]: a great message with data - "bar"

logger.warn('this is a warning');
// expected output: [2019-05-14T15:51:25.623Z][PID=1929][WARN]: this is a warning

logger.error('this is an error');
// expected output: [2019-05-14T15:51:25.623Z][PID=1929][ERROR]: this is an error

logger.debug('this message will only appear in debug mode');
// expected output: [2019-05-14T15:51:25.623Z][PID=1929][DEBUG]: this message will only appear in debug mode

logger.deprecated('this functionality is deprecated');
// expected output: [2019-05-14T15:51:25.623Z][PID=1929][DEPRECATED]: this functionality is deprecated
```

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