# @printy/logger

> Simple logging utility class

Latest version **1.0.1** (published 2023-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @printy/logger
pnpm add @printy/logger
yarn add @printy/logger
bun add @printy/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.0.1 |
| Published | 2023-10-02 |
| First published | 2023-10-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | JorensM |
| Maintainers | jorensm |
| Keywords | logs, logger, logging, log, utility, class, typescript |

## Links

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

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-10-02
- 1.0.0 — 2023-10-02

## README

# Logger

A basic logging utility class. Supports prefixes, enabled/disabled state and tags/filters.

This package is useful for when you have a lot of different logs and you want to filter them out quickly without needing to remove them/comment them out.

Usage:

```
import Logger from "@printy/logger"

//--Basic usage--//

const logger = new Logger(true, 'My log')

logger.log('This is my log!')

//Output: 
//My log: This is my log!

//--Disabling--//

logger.enabled = false

logger.log('This won\'t log!')

//Output:

//--Filters--//

logger.enabled = true

logger.filters = ["filter1", "filter2"]

logger.log('This will log!', 'filter1')

logger.log('This will also log!', 'filter2')

logger.log('This won\'t log!', 'filter3')

//Output:
//My log: This will log!
//My log: This will also log!

```

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