<commit_before>Create a console logger w/ formatting, timestamp, color, namespace

_Source: [lib/long-con/index.js](../lib/long-con/index.js)_

- [exports.LongCon](#exportslongcon)
- [exports.create](#exportscreate)
- [exports.extend](#exportsextendext)
- [LongCon](#longcon)
- [LongCon.prototype.log](#longconprototypelogname-fn-namecolor-bodycolor-args)
- [LongCon.prototype.create](#longconprototypecreate)
- [LongCon.prototype.traceMethods](#longconprototypetracemethodsname-obj-logger-filterall-omitnone)

# exports.LongCon()

> Reference to [LongCon](#longcon).

# exports.create()

> Create a new [LongCon](#longcon).

**Return:**

`{LongCon}`

# exports.extend(ext)

> Extend [LongCon](#longcon).prototype.

**Parameters:**

- `{object} ext` Methods to mix in.

**Return:**

`{object}` Merge result.

# LongCon()

> LongCon constructor.

**Usage:**

```js
var longCon = require('long-con').create(); // new LongCon() instance
```

**Example configuration:**

```js
loncCon
  .set('namespace', 'myLib');
var log = longCon.create('[stderr]', console.error, 'red.bold');

// [stderr] myLib error message: ...
log('error message: %s', ...);
```

**Configuration:**

 - `{string} [namespace='']` Prepend to each message
 - `{string} [nlFirst=false]` Prepend `\n` to first log
 - `{string} [quiet=false]` Drop all messages
 - `{string} [time=false]` Prepend `toUTCString()`
 - `{string} [traceIndent='    ']` Represent a stack level (default: 4 spaces)
 - `{string} [traceLanes=true]` Prepend each traceIndent with `|`

**Properties:**

 - `{number} [stackDepth=0]` Used to size indentation and draw trace lanes
 - `{boolean} firstLine` Supports `nlFirst` config option

**See:**

- [cli-color](https://github.com/medikoo/cli-color)

# LongCon.prototype.log(name, fn, nameColor, bodyColor, args*)

> `util.format()` wrapper with timestamp and injected output function.
Respects `quiet` config. Applies color selection.

**Parameters:**

- `{string} name` Source logger's name, ex. 'stderr'
- `{function} fn` Ex. `console.error`
- `{string} nameColor` `name` color, ex. 'yellow' or 'white.bgRed'
  - `cli-color` foreground and optional background

- `{boolean | string} bodyColor`

{boolean} If true, match `nameColor`
{string} Custom `cli-color`

- `{mixed} args*` `util.format()` compatible

**See:**

- [cli-color](https://github.com/medikoo/cli-color)

# LongCon.prototype.create()

> Create a [LongCon.prototype.log](#longconprototypelogname-fn-namecolor-bodycolor-args) wrapper with fixed arguments.

Returned function ('primary') also has two properties.

- `{function} push`: Emits a log message and pushes a stack level.
  - Accepts same arguments as primary.
- `{function} pop`: Pops a stack level. Optionally emits a log message.
  - Optionally accepts same arguments as primary.

**Return:**

`{function}` Accepts `util.format()` arguments

**See:**

- [LongCon.prototype.log](#longconprototypelogname-fn-namecolor-bodycolor-args) for fixable arguments

# LongCon.prototype.traceMethods(name, obj, logger, [filter=all], [omit=none])

> Wrap an object's methods to allow log messages to appear within a stack trace
isolated to that object.

**Parameters:**

- `{string} name` Uniquely identify the object
- `{object} obj`
- `{function} logger` From [LongCon.prototype.create](#longconprototypecreate)
- `{regexp | object} [filter=all]` Include matching key names
  - `filter`: If an object, its keys are used.

- `{regexp} [omit=none]` Exclude matching key names

_&mdash;generated by [apidox](https://github.com/codeactual/apidox)&mdash;_<commit_msg>docs(api): Regenerate<commit_after>Create a console logger w/ formatting, timestamp, color, namespace

_Source: [lib/long-con/index.js](../lib/long-con/index.js)_

<a name="tableofcontents"></a>

- <a name="toc_exports"></a>[exports.LongCon](#exportslongcon)
- [exports.create](#exportscreate)
- [exports.extend](#exportsextendext)
- <a name="toc_longcon"></a>[LongCon](#longcon)
- <a name="toc_longconprototype"></a>[LongCon.prototype.log](#longconprototypelogname-fn-namecolor-bodycolor-args)
- [LongCon.prototype.create](#longconprototypecreate)
- [LongCon.prototype.traceMethods](#longconprototypetracemethodsname-obj-logger-filterall-omitnone)

<a name="exports"></a>

# exports.LongCon()

> Reference to [LongCon](#longcon).

<sub>Go: [TOC](#tableofcontents) | [exports](#toc_exports)</sub>

# exports.create()

> Create a new [LongCon](#longcon).

**Return:**

`{LongCon}`

<sub>Go: [TOC](#tableofcontents) | [exports](#toc_exports)</sub>

# exports.extend(ext)

> Extend [LongCon](#longcon).prototype.

**Parameters:**

- `{object} ext` Methods to mix in.

**Return:**

`{object}` Merge result.

<sub>Go: [TOC](#tableofcontents) | [exports](#toc_exports)</sub>

# LongCon()

> LongCon constructor.

**Usage:**

```js
var longCon = require('long-con').create(); // new LongCon() instance
```

**Example configuration:**

```js
loncCon
  .set('namespace', 'myLib');
var log = longCon.create('[stderr]', console.error, 'red.bold');

// [stderr] myLib error message: ...
log('error message: %s', ...);
```

**Configuration:**

 - `{string} [namespace='']` Prepend to each message
 - `{string} [nlFirst=false]` Prepend `\n` to first log
 - `{string} [quiet=false]` Drop all messages
 - `{string} [time=false]` Prepend `toUTCString()`
 - `{string} [traceIndent='    ']` Represent a stack level (default: 4 spaces)
 - `{string} [traceLanes=true]` Prepend each traceIndent with `|`

**Properties:**

 - `{number} [stackDepth=0]` Used to size indentation and draw trace lanes
 - `{boolean} firstLine` Supports `nlFirst` config option

**See:**

- [cli-color](https://github.com/medikoo/cli-color)

<sub>Go: [TOC](#tableofcontents)</sub>

<a name="longconprototype"></a>

# LongCon.prototype.log(name, fn, nameColor, bodyColor, args*)

> `util.format()` wrapper with timestamp and injected output function.
Respects `quiet` config. Applies color selection.

**Parameters:**

- `{string} name` Source logger's name, ex. 'stderr'
- `{function} fn` Ex. `console.error`
- `{string} nameColor` `name` color, ex. 'yellow' or 'white.bgRed'
  - `cli-color` foreground and optional background

- `{boolean | string} bodyColor`

{boolean} If true, match `nameColor`
{string} Custom `cli-color`

- `{mixed} args*` `util.format()` compatible

**See:**

- [cli-color](https://github.com/medikoo/cli-color)

<sub>Go: [TOC](#tableofcontents) | [LongCon.prototype](#toc_longconprototype)</sub>

# LongCon.prototype.create()

> Create a [LongCon.prototype.log](#longconprototypelogname-fn-namecolor-bodycolor-args) wrapper with fixed arguments.

Returned function ('primary') also has two properties.

- `{function} push`: Emits a log message and pushes a stack level.
  - Accepts same arguments as primary.
- `{function} pop`: Pops a stack level. Optionally emits a log message.
  - Optionally accepts same arguments as primary.

**Return:**

`{function}` Accepts `util.format()` arguments

**See:**

- [LongCon.prototype.log](#longconprototypelogname-fn-namecolor-bodycolor-args) for fixable arguments

<sub>Go: [TOC](#tableofcontents) | [LongCon.prototype](#toc_longconprototype)</sub>

# LongCon.prototype.traceMethods(name, obj, logger, [filter=all], [omit=none])

> Wrap an object's methods to allow log messages to appear within a stack trace
isolated to that object.

**Parameters:**

- `{string} name` Uniquely identify the object
- `{object} obj`
- `{function} logger` From [LongCon.prototype.create](#longconprototypecreate)
- `{regexp | object} [filter=all]` Include matching key names
  - `filter`: If an object, its keys are used.

- `{regexp} [omit=none]` Exclude matching key names

<sub>Go: [TOC](#tableofcontents) | [LongCon.prototype](#toc_longconprototype)</sub>

_&mdash;generated by [apidox](https://github.com/codeactual/apidox)&mdash;_
{'fraction_non_alphanumeric': 0.17544534153530694, 'fraction_numerical': 0.0005126233499935922, 'mean_word_length': 5.268273092369478, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 43, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '713689', 'n_tokens_mistral': 2702, 'n_tokens_neox': 2576, 'n_words': 645}