# typescript-log

> Logger interface with a few simple implementations, interface compatible with pino, bunyan and probably others

Latest version **2.0.0** (published 2020-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install typescript-log
pnpm add typescript-log
yarn add typescript-log
bun add typescript-log
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2020-06-18 |
| First published | 2018-12-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Jake Ginnivan |
| Maintainers | jakeginnivan |
| Keywords | typescript, Logger, pino, bunyan, types |

## Links

- npm: https://www.npmjs.com/package/typescript-log
- Repository: https://github.com/sevenwestmedia-labs/typescript-log
- Homepage: https://github.com/sevenwestmedia-labs/typescript-log#readme
- Issues: https://github.com/sevenwestmedia-labs/typescript-log/issues
- npm.io page: https://npm.io/package/typescript-log

## 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

- 2.0.0 (latest) — 2020-06-18
- 1.1.1 — 2019-08-29
- 1.1.0 — 2019-01-10
- 1.0.0 — 2018-12-31

## README

# TypeScript abstract logger

![](https://img.shields.io/npm/v/typescript-log.svg)

Useful for libraries which want to enable the consuming application to provide a logger. Our projects ended up duplicating the same logging interface and consoleLogger and noopLogger's.

Compatible with universal applications (works in browser and node)

## Usage

```ts
import pino from 'pino'
import { consoleLogger, noopLogger, Logger } from 'typescript-log'

const pinoLogger: Logger = pino({})

const logsNothingLogger: Logger = noopLogger()
const logsToConsoleLogger: Logger = consoleLogger(
    /* optional, warn default */ 'error',
)
```

## References

Similar to https://github.com/kallaspriit/ts-log but uses `log(obj, msg)` format for the interface

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