# logrx

> Small, configurable logging library on top of rxjs

Latest version **1.1.3** (published 2018-10-08) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.1.3 |
| Published | 2018-10-08 |
| First published | 2017-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 324.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Olivier Amblet |
| Maintainers | oliamb |

## Links

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

## Dependencies (2)

- [rxjs](https://npm.io/package/rxjs.md) 6.2.2
- [typescript](https://npm.io/package/typescript.md) 2.9.2

## Recent versions

- 1.1.3 (latest) — 2018-10-08
- 1.1.2 — 2017-12-11
- 1.1.1 — 2017-12-11
- 1.1.0 — 2017-12-11
- 1.0.0 — 2017-11-13
- 0.0.1 — 2017-11-13

## README

# logrx, a javascript logger built with rxjs

![build status](https://travis-ci.org/oliamb/logrx.svg?branch=master)

Features:

- [x] mimic a subset of the Console API
- [x] support log level configuration
- [x] support having multiple logger  implementation running in parallel
- [x] support multiple configurations
- [x] support multiple logging backend
- [x] provide an extensible API
- [ ] leverage rxjs whenever possible
- [ ] is lightweight

## Getting Started

Using the global context, without customization.

```js
const logger = getLogger('db');
logger.log('Hello World');
```

Configure a logger using its name.

```js
import { configure, getLogger, Level } from 'logrx';
configure({
  name: 'api-call',
  appenders: ['console'],
  level: Level.ERROR
});
const logger = getLogger('api-call');
logger.error('Hello Error', new Error('some issue'));
```

Using a separate context:

```js
import { configure, getLogger, Level, ROOT_LOGGER_NAME } from 'logrx';

export const context = new LoggerContext();

context.configure({
  name: ROOT_LOGGER_NAME,
  appenders: [],
  level: Level.OFF
}, {
  name: 'api-call',
  appenders: ['console'],
  level: Level.INFO
});

// ---- //

const logger = getLogger('db');
logger.log('SELECT', 'ID=', 5);
```

## Contributing

This project is at a very early stage and will be open to contributions as soon as it proved to be an interesting library.

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