# @shieldsbetter/log-formatter

> A pleasing log formatter with line-wrap and indentation.

Latest version **0.0.1** (published 2016-07-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install @shieldsbetter/log-formatter
pnpm add @shieldsbetter/log-formatter
yarn add @shieldsbetter/log-formatter
bun add @shieldsbetter/log-formatter
```

## 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.0.1 |
| Published | 2016-07-31 |
| First published | 2016-07-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Hampton Smith |
| Maintainers | shieldsbetter |

## Links

- npm: https://www.npmjs.com/package/@shieldsbetter/log-formatter
- Repository: https://github.com/hamptonsmith/log-formatter
- Homepage: https://github.com/hamptonsmith/log-formatter#readme
- Issues: https://github.com/hamptonsmith/log-formatter/issues
- npm.io page: https://npm.io/package/@shieldsbetter/log-formatter

## Dependencies (2)

- [merge](https://npm.io/package/merge.md) ^1.2.0
- [linewrap](https://npm.io/package/linewrap.md) ^0.2.1

## Recent versions

- 0.0.1 (latest) — 2016-07-31

## README

@shieldsbetter/log-formatter
============================

A pleasing node log formatter with word-wrap and indentation.

```
INFO: Sometimes it's nice to get line
      wrapping with your debug output that
      respects things like:
      * Internal line breaks
      * Traditional line delimeters
      Butthatalsomaintainsindentationforde
      linquentlines
  INFO: It's also nice if recursive depth
        can be visually indicated using
        indentation without child calls
        needing to 'know' what level they
        are on.
With indentation naturally returning to
the correct depth once child calls are
complete.
      
```

Usage
-----
```javascript
var logger = require('@shieldsbetter/log-formatter');

logger.log('Output without a prefix.');
logger.log('INFO: ', 'Output with a prefix.');

logger.begin();
logger.log('Output at the next level of indentation.');

logger.begin();
logger.log('And the next!');

logger.end();
logger.end();
logger.log('Back to the bottom level.');
```

Output:

```
Output without a prefix.
INFO: Output with a prefix.
    Output at the next level of indentation.
        And the next!
Back to the bottom level.
```

Options
-------
For more fine grained control, pass options to the logger object:

```javascript
var logger = require('@shieldsbetter/log-formatter')({
            indent: 8,
            out : function(text) { process.stderr.write(text + '\n'); },
            lineLength: 78
        });
```

Your available options are:

* **indent** (default: 4) - number of spaces to indent at each level
* **out** (default: console.log) - function that processes each line of output
* **lineLength** (default: 80) - maximum column width

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