# show-log-lines

> Simple module that shows you where all ytour console.logs are for even better code debugging.

Latest version **1.0.8** (published 2022-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install show-log-lines
pnpm add show-log-lines
yarn add show-log-lines
bun add show-log-lines
```

## 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.8 |
| Published | 2022-10-12 |
| First published | 2022-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Anthony Munegdi |
| Maintainers | nguru |
| Keywords | console, log, logger, show, location, line, file, caller |

## Links

- npm: https://www.npmjs.com/package/show-log-lines
- Repository: https://github.com/mugendi/show-log-lines
- Homepage: https://github.com/mugendi/show-log-lines#readme
- Issues: https://github.com/mugendi/show-log-lines/issues
- npm.io page: https://npm.io/package/show-log-lines

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [callsites](https://npm.io/package/callsites.md) ^3.1.0
- [picomatch](https://npm.io/package/picomatch.md) ^2.3.1

## 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.8 (latest) — 2022-10-12
- 1.0.7 — 2022-10-09
- 1.0.6 — 2022-09-09
- 1.0.5 — 2022-08-22
- 1.0.4 — 2022-08-19
- 1.0.3 — 2022-08-19
- 1.0.2 — 2022-08-01
- 1.0.1 — 2022-06-05
- 1.0.0 — 2022-06-02

## README

# How about simplifying your logs?

When coding in Javascript, many developers have the habit of using `console.log` to track their code and test variables.

However, as the project increases in complexity and size, these logs can get lost in your code and tracing them becomes another task altogether!

This module patches the `console.log` method so that it also logs all important information about where every log is to be found.

# Usage

Install using `yarn add show-log-lines`
Then require the module at the very top of your project: `javascript require('show-log-lines');`

# Example

```javascript
// require module at the very top
require('show-log-lines')({ short: false });

// log something
console.log('Hello ' + test_function());

function test_function() {
	// log something else inside function
	console.log('Inside Test Function');
	return 'World';
}
```

## Result

The code above will output something like this

![Image](https://repository-images.githubusercontent.com/498966507/cec68530-f673-4727-b4f5-30c9ed41171c)

# Options

-   `short` : which is a boolean value. The default is **true** which prints only the line number.
-   `ignorePaths` : a glob path or list of globs from which paths this module will not decorate the logs. Example: `['**/node_modules/moleculer/**']` will ignore all logs emanating from the moleculer module. [Picomatch](https://www.npmjs.com/package/picomatch) is used to match globs so check out their readme.

-   `utilInspect` : an object containing values to be passed to `util.inspect()` method. The default is :

    `{ depth: 4, showHidden: false, colors: true, compact: true }`

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