# @execonline-inc/logging

> Console and warnings and alerting for background logging

Latest version **6.4.0** (published 2022-11-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install @execonline-inc/logging
pnpm add @execonline-inc/logging
yarn add @execonline-inc/logging
bun add @execonline-inc/logging
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.4.0 |
| Published | 2022-11-09 |
| First published | 2019-12-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ryan L. Bell |
| Maintainers | kofno |

## Links

- npm: https://www.npmjs.com/package/@execonline-inc/logging
- Repository: https://github.com/execonline-inc/CooperTS
- Homepage: https://github.com/execonline-inc/CooperTS#readme
- Issues: https://github.com/execonline-inc/CooperTS/issues
- npm.io page: https://npm.io/package/@execonline-inc/logging

## Dependencies (2)

- [date-fns](https://npm.io/package/date-fns.md) ^2.28.0
- [@execonline-inc/environment](https://npm.io/package/@execonline-inc/environment.md) ^5.7.0

## Recent versions

- 6.4.0 (latest) — 2022-11-09
- 6.3.0 — 2022-11-09
- 6.2.1 — 2022-09-06
- 6.2.0 — 2022-08-23
- 6.1.0 — 2022-08-08
- 6.0.0 — 2022-05-24
- 5.5.0 — 2022-05-23
- 5.4.0 — 2022-03-25
- 5.3.0 — 2021-07-21
- 5.2.0 — 2021-07-01
- 5.1.1 — 2021-06-17
- 5.1.0 — 2021-06-15
- 5.0.0 — 2021-05-13
- 4.0.0 — 2021-03-01
- 3.0.0 — 2020-12-09
- … 5 more at https://npm.io/package/@execonline-inc/logging/versions

## README

# `logging`

The `logging` package provides a few logging functions.

## Functions

### `logger`

This curried function provides a console logging function with a given prefix.

```ts
import { logger } from '@execonline-inc/logging';

const logger = logger('[EXAMPLE]');
logger('abc', 'def');
// [EXAMPLE] abc def
```

### `warner`

This curried function provides a console warning function with a given prefix.

```ts
import { warner } from '@execonline-inc/logging';

const warner = warner('[EXAMPLE]');
warner('abc', 'def');
// [EXAMPLE] abc def
```

### `log`

_Specific to ExecOnline_

A `logger` with an `[EXO]` prefix.

```ts
import { log } from '@execonline-inc/logging';

log('hello');
// [EXO] hello
```

### `logWithTimestamp`

A logger with a timestamp prefix.

```ts
import { logWithTimestamp } from '@execonline-inc/logging';

logWithTimestamp('hello');
// [2022-05-23T16:34:13.462-04:00] hello
```

### `warn`

_Specific to ExecOnline_

A `warner` with an `[EXO]` prefix.

```ts
import { warn } from '@execonline-inc/logging';

warn('hello');
// [EXO] hello
```

### `warnAndNotify`

_Specific to ExecOnline_

This function accepts an error name, an error message, and a context object. It sends the message to the console using `warn`, and also uses the provided information to post a notification to the third-party [Honeybadger](https://www.honeybadger.io/) exception monitoring service.

```ts
import { warnAndNotify as warnAndNotifyImpl } from '@execonline-inc/logging';

export const warnAndNotify = warnAndNotifyImpl(Honeybadger.notify);

const context = { user_id: 123 };
warnAndNotify('ErrorName', 'Some error message', context);
// [EXO] Some error message
```

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