# pretty-shell-logs

> Utilities package for have a really consultable console

Latest version **0.1.3** (published 2018-11-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install pretty-shell-logs
pnpm add pretty-shell-logs
yarn add pretty-shell-logs
bun add pretty-shell-logs
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2018-11-08 |
| First published | 2018-09-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 498.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Zoid23 |
| Maintainers | zoid23 |
| Keywords | logs, console, warning, error, info, debug, color |

## Links

- npm: https://www.npmjs.com/package/pretty-shell-logs
- Homepage: https://github.com/luigivitelli23/pretty-shell-logs
- npm.io page: https://npm.io/package/pretty-shell-logs

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 0.1.3 (latest) — 2018-11-08
- 0.1.2 — 2018-11-08
- 0.1.1 — 2018-09-10
- 0.1.0 — 2018-09-09

## README

# Pretty shell logs
 [![NPM](https://img.shields.io/badge/pretty%20shell%20logs-0.1.3-blue.svg?logo=npm&longCache=true&style=flat)](https://www.npmjs.com/package/pretty-shell-logs)

Package to have a really consultable console

## TAGS and PRETTY OBJ

The core implementation for this library is the tagging (paired with a color) to identify a log *competence area* and an easy object rapresentation thanks to `log.pretty()` method

#### Configuration

| Parameter | Description | Default value |
|:------------- |:--------------- |:-------------:|
| titleMinimumWidth | the minimum space for the title section | `14` |
| level | log level *debug*, *info*, *warn*, *errorOrSuccess*, *nothing* | `debug` |
| grep.title | filter for a title | `''` |
| grep.content | filter for a content | `''` |
| exclude.title | hide title occurrences | `''` |
| exclude.content | hide content occurrence | `''` |
| showDate | set the date visibility | `true` |
| titleColorReverse | invert the title and background colors | `true` |
| showLevelLabel | set the log level label visibility | `true` |


### Implementation example

```javascript
const logger = require('./index')

logger.init({
  	titleMinimumWidth: 10,
	level: 'debug',
	showDate: false,
  	titleColorReverse: true,
  	showLevelLabel: false,
	grep: {
		title: 'server',
		content: '',
	},
	exclude: {
		title: '',
		content: '',
	},
})

const obj = {
	foo: 'bar',
}

const tagOneLog = logger.create('Tag nr 1', 'blue')
tagOneLog.d('Debug log')
tagOneLog.i('Info log')
tagOneLog.w('Warning log')
tagOneLog.error('Warning log')

const tagTwoLog = logger.create('Tag nr 2', 'magenta')
tagTwoLog.e('Error log')
tagTwoLog.s('Success log')
tagTwoLog.w('Warning log with a \'pretty\' object',obj, tagTwoLog.pretty(obj, 'Object description'))
```

#### Usage results

<img src="https://github.com/luigivitelli23/pretty-shell-logs/raw/master/img/example.png">

`titleColorReverse` as *true*:

<img src="https://github.com/luigivitelli23/pretty-shell-logs/raw/master/img/example_dark.png">

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