# @vanillas/chalk-console-logger

> An enhanced version of @vanillas/console-logger which injects an instance of chalk into any functions passed into a logger method

Latest version **1.0.0** (published 2021-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vanillas/chalk-console-logger
pnpm add @vanillas/chalk-console-logger
yarn add @vanillas/chalk-console-logger
bun add @vanillas/chalk-console-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.0 |
| Published | 2021-09-03 |
| First published | 2021-09-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.17.0 |
| Dependencies | 2 |
| Unpacked size | 8.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Nunez |
| Maintainers | developerdave |
| Keywords | log, chalk, logging, console, log levels, log thresholds, console logging, threshold logging |

## Links

- npm: https://www.npmjs.com/package/@vanillas/chalk-console-logger
- Repository: https://github.com/arizonatribe/vanillas-packages
- Homepage: https://github.com/arizonatribe/vanillas-packages/blob/main/packages/chalk-console-logger/README.md
- Issues: https://github.com/arizonatribe/vanillas-packages/issues
- npm.io page: https://npm.io/package/@vanillas/chalk-console-logger

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [@vanillas/console-logger](https://npm.io/package/@vanillas/console-logger.md) ^1.0.0

## 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
- [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
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-09-03

## README

# Chalk Console Logger

A wrapper around the native Console API but which supports top-down threshold (levels) based control and injects an instance of the [chalk](https://www.npmjs.com/package/chalk) into any functions passed into the [@vanillas/console-logger](https://www.npmjs.com/package/@vanillas/console-logger) methods.

# Installation

```
npm install @vanillas/chalk-console-logger
```

# Usage

Try it out in the NodeJs shell either next to a `node_modules/` directory where `@vanillas/console-logger` has been installed, _or_ try using [replem](https://www.npmjs.com/package/replem) as a global NPM package so you can load any NPM package into a NodeJs shell.

```
$ replem @vanillas/chalk-console-logger:logger

Installed into REPL context:
 - @vanillas/console-logger@1.0.0 as logger

> logger.level
'info'
> logger.setLevel("trace")
> logger.trace("Some very verbose logging statement")
Some very verbose logging statement
> logger.setLevel("debug")
> logger.trace("Some very verbose logging statement")
> logger.debug("Some slightly less verbose logging statement")
Some slightly less verbose logging statement
> logger.setLevel("warn")
> logger.info("Normal stuff to log to stdout")
> logger.error("something broke"
something broke
```

The only thing happening in this example is writing normal logging statements but the ones _below_ the current logger threshold level never show up.

A NodeJs shell is just a quick way to demonstrate functionality for a simple package like this one, but in a front-end or back-end JavaScript/TypeScript appliction you instead just `import` this package and use it in the same manner demonstrated in the shell.

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