# @paralect/common-logger

> Simple, preconfigured logger

Latest version **0.1.10** (published 2017-07-30) · 0 weekly downloads

## Install

```sh
npm install @paralect/common-logger
pnpm add @paralect/common-logger
yarn add @paralect/common-logger
bun add @paralect/common-logger
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.10 |
| Published | 2017-07-30 |
| First published | 2017-07-30 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Paralect Service Stack |
| Maintainers | paralect |

## Links

- npm: https://www.npmjs.com/package/@paralect/common-logger
- npm.io page: https://npm.io/package/@paralect/common-logger

## Dependencies (1)

- [winston](https://npm.io/package/winston.md) 2.3.1

## Recent versions

- 0.1.10 (latest) — 2017-07-30
- 0.1.0 — 2017-07-30

## README

# Common Logger

Common logger is preconfigured console based logger. Currently based on [winston](https://github.com/winstonjs/winston).

### Installation

```
npm i @paralect/common-logger
```

### Usage

Create `logger.js` file in the root of your project:

```
const createConsoleLogger = require('@paralect/common-logger').createConsoleLogger;

module.exports = createConsoleLogger({ isDev: true });
```

By default isDev is set to `false` in logger. If set to true, two things will happen:

1. All logs output will be in plain text (vs `json` for production like environments)
2. For development environment logger will also output all `logger.debug()` messages, while none dev info and above.

### Expose logger as global object

Since logger is such a common thing, it make sense to expose it as global variable, so it simpler to use it across the project.

```
global.logger = require('./logger');

// In a place, where you need logger:
const logger = global.logger;
```

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