# @basaas/node-logger

> A simple wrapper around winston logger

Latest version **1.1.5** (published 2019-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @basaas/node-logger
pnpm add @basaas/node-logger
yarn add @basaas/node-logger
bun add @basaas/node-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.5 |
| Published | 2019-02-12 |
| First published | 2017-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Basaas GmbH |
| Maintainers | basaas-dev |

## Links

- npm: https://www.npmjs.com/package/@basaas/node-logger
- npm.io page: https://npm.io/package/@basaas/node-logger

## Dependencies (2)

- [uuid](https://npm.io/package/uuid.md) 3.1.0
- [winston](https://npm.io/package/winston.md) 2.4.0

## Recent versions

- 1.1.5 (latest) — 2019-02-12
- 1.1.4 — 2019-02-12
- 1.1.3 — 2019-02-12
- 1.1.2 — 2018-06-07
- 1.1.1 — 2017-12-18
- 1.1.0 — 2017-12-18
- 1.0.2 — 2017-11-22
- 1.0.1 — 2017-11-15

## README

# README #

This is a utility library, which uses internally `winston` logger (s. https://www.npmjs.com/package/winston)

### How do I get set up? ###

```
const Logger = require('@basaas/node-logger');

const myLogger = Logger.getLogger('my-logger', {
    level: 'info'   // defaults to 'warn' in production and otherwise 'info'
});

myLogger.info('hello');
myLogger.warn({foo: 42});
myLogger.error(new Error('oh noes!'));
```

#### Logging multiple arguments ####
If you pass more than one argument to the logger function, then the arguments will be concatenated to a single string whilst the last arguments will be interpreted as metadata.
```
myLogger.info('hello', {foo: 42});
```
will be logged as:
```
{"foo":42,"level":"info","message":"[blubb] hello"}
```

#### Environment Variables ####

* *NODE_ENV* - logs in json format if `production`, otherwise uses the default from 'winston'
* *DEBUG* - if `true` then sets the default log level to 'debug'

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