# @mvf/logger

> ## Usage

Latest version **1.0.10** (published 2024-11-28) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 40/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2024-11-28 |
| First published | 2020-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 116.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | dovydas.rupsys, michaelkingmvf, john.felton, jrrsmvf, russellwind-mvf, laleh.koupaei, arnicsm, gijserensteinmvf |

## Links

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

## Dependencies (2)

- [morgan](https://npm.io/package/morgan.md) ^1.10.0
- [winston](https://npm.io/package/winston.md) ^3.3.3

## Recent versions

- 1.0.10 (latest) — 2024-11-28
- 1.0.9 — 2024-04-03
- 1.0.8 — 2024-04-03
- 1.0.7 — 2024-04-02
- 1.0.6 — 2024-04-02
- 1.0.5 — 2024-04-02
- 1.0.4 — 2024-03-28
- 1.0.3 — 2022-01-31
- 1.0.2 — 2021-09-27
- 1.0.1 — 2020-08-29
- 1.0.0 — 2020-08-29
- 0.0.9 — 2020-08-28
- 0.0.8 — 2020-08-28
- 0.0.7 — 2020-08-25
- 0.0.6 — 2020-08-24
- … 5 more at https://npm.io/package/@mvf/logger/versions

## README

# MVF Logger

## Usage

Provides a consistent logging output for javascript applications.

### To install the package

Run `npm install @mvf/logger`

### How to use

Import log function of your choice and then use them to output a log message.

```ts
import { info, warning, error } from "@mvf/logger";

info("info message");
warning("info message");
error("info message");
```

The logger can also accept an object of extra data, which will be logged together with the message.

```ts
import { info } from "@mvf/logger";

info("info message", {
  clickId: "...",
  ...
});
```

### Exceptions

Logger is configured to catch any unhandled exceptions and output them to the console in a json format, consistent with the other log messages.

### Testing

Logger will be silent, it will not log anything, if `ENVIRONMENT_FILE` env variable is set to `testing`.

### Formatting

Logger will format output using `prettyPrint` formatter if `ENVIRONMENT_FILE` env variable is set to `development` in all other cases `json` formatter will be used to ensure consistent log output.

## Contributing

### Setup

- Run `make` to build the container
- Run `make shell` to enter the container
- Run `npm install` to install dependencies

Refer to package.json for commands

### After merging

After you have merged a PR to master, you need to rebuild and publish your changes.

1. Checkout master `git checkout master && git pull`
2. Use one of the following make publish commands to publish changes:
   - `make publish kind=patch` - Use this if your change is a bug fix and is backwards compatible.
   - `make publish kind=minor` - Use this if your change adds new functionality and is backwards compatible.
   - `make publish kind=major` - Use this if your change is not backwards compatible.

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