# @dopt/logger

> A logger package with configuration to set severity loglevel for your standard console logs

Latest version **0.2.0** (published 2023-09-12) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-09-12 |
| First published | 2022-10-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 117.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | kseth, alexchantastic, pankaj-avhad-dopt, chasebish, dopt_carlos, joemckenney |

## Links

- npm: https://www.npmjs.com/package/@dopt/logger
- Repository: https://github.com/dopt/odopt
- Homepage: https://github.com/dopt/odopt/tree/main/packages/%40dopt/logger
- Issues: https://github.com/dopt/odopt/issues
- npm.io page: https://npm.io/package/@dopt/logger

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) 4.1.2
- [loglevel](https://npm.io/package/loglevel.md) 1.8.1

## Recent versions

- 0.2.0 (latest) — 2023-09-12
- 0.1.0 — 2023-08-28
- 0.0.3 — 2023-02-16
- 0.0.2 — 2023-02-15
- 0.0.1 — 2022-11-02
- 0.0.0 — 2022-10-31

## README

# Dopt Logger

## Getting Started

The Dopt Logger offers a convenient framework for support logLevel configuration and templated logging. Allowing you to enable logging in your packages based on log levels and with defined styled template for your node terminal and browser console.

## Installation

Via npm:

```bash
npm install @dopt/logger
```

Via Yarn:

```bash
yarn add @dopt/logger
```

Via pnpm:

```bash
pnpm add @dopt/logger
```

## Usage

### Initialization

You can initialize Dopt in your app by integrating the `Logger` as follows:

```js
import { Logger } from '@dopt/logger';

const log = new Logger({ logLevel: 'debug', prefix: ` <Any Prefix> ` });
log.info('This is informational log');
```

**Note:** For debugging purposes, you can add a `logLevel` prop to `Logger` which sets the minimum log level printed to the console. This accepts the following values: `'trace'`, `'debug'` `'info'`, `'warn'`, `'error'`, `'silent'` (default) .

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