# @leanylabs/logger

> LeanyLabs Logger

Latest version **1.2.0** (published 2023-01-05) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2023-01-05 |
| First published | 2021-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | LeanyLabs |
| Maintainers | mzahor, leanylabs-release-bot |

## Links

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

## Dependencies (2)

- [winston](https://npm.io/package/winston.md) ^3.3.4
- [winston-console-format](https://npm.io/package/winston-console-format.md) ^1.0.8

## Recent versions

- 1.2.0 (latest) — 2023-01-05
- 1.1.0 — 2023-01-05
- 1.0.9 — 2022-09-05
- 1.0.8 — 2022-09-05
- 1.0.7 — 2022-09-05
- 0.0.6 — 2022-01-11
- 0.0.5 — 2021-07-19
- 0.0.4 — 2021-07-16
- 0.0.2 — 2021-07-16

## README

## Usage

You have two ways to use the lib:

1.  With default env variables name (which are: LOGGING_LEVEL, SERVICE_NAME and isProd which depends on NODE_ENV either including partial string 'prod' or not), the values of the variables must be defined in your process enviroment

```js
const { logger } = require("@leanylabs/logger");

logger.info("hello world");
```

2.  Pass the needed variables manually into initially imported function 'createLogger' and then by means of in create the logger itself

```js
const { createLogger } = require("@leanylabs/logger");

const logger = createLogger({
  isProduction: false,
  level: "silly",
  labels: {
    serviceName: "test",
  },
});
```

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