# keypunch

> NodeJS Logging Module without the fancy bits.

Latest version **1.0.5** (published 2016-12-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install keypunch
pnpm add keypunch
yarn add keypunch
bun add keypunch
```

## 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.5 |
| Published | 2016-12-03 |
| First published | 2016-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Joe Kent |
| Maintainers | deadlybutter |
| Keywords | logging, logs |

## Links

- npm: https://www.npmjs.com/package/keypunch
- Repository: https://github.com/deadlybutter/keypunch
- Homepage: https://github.com/deadlybutter/keypunch#readme
- Issues: https://github.com/deadlybutter/keypunch/issues
- npm.io page: https://npm.io/package/keypunch

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3

## 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.5 (latest) — 2016-12-03
- 1.0.4 — 2016-11-23
- 1.0.3 — 2016-11-12
- 1.0.2 — 2016-11-12
- 1.0.1 — 2016-11-12
- 1.0.0 — 2016-11-12

## README

# keypunch
NodeJS Logging Module without the fancy bits.

## Setup
`npm install keypunch --save`

```
const console = require('keypunch');
console.log("Hey it works!", "oh thats sick");
```

### Log Functions
`debug` - Logs all function arguments & a stack trace.

`log` - Logs all function arguments.

`info` - Logs all function arguments.

`warn` - Logs all function arguments.

`error`- Logs all function arguments.

`stackTrace` - Logs all function arguments & a stack trace.


### Log Levels
Each log function has an assigned level. When initiating your app remember to set the Keypunch log level, either with `process.env.LOG_LEVEL` or via JS as shown below.

```
const console = require('keypunch');
console.logLevel = 3;
...
console.debug("testing the request fired", req); // Won't fire a log message
```

#### Levels
`debug` - 1

`log` - 2

`info` - 3

`warn` - 4

`error`- 5

`stackTrace` - 5

### Message prefixing
Message output by themselves can often require more context. Keypunch lets you add your own functions to modify the start of a log message. Here are some examples,

```
console.addHeaderFunction((type) => `[MyPackage (${type})] `);
console.addHeaderFunction((type) => new Date().toString());
```

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