https://github.com/edwinm/rxjslog
Log RxJS events nicely to the console
https://github.com/edwinm/rxjslog
console logging rxjs
Last synced: 2 months ago
JSON representation
Log RxJS events nicely to the console
- Host: GitHub
- URL: https://github.com/edwinm/rxjslog
- Owner: edwinm
- License: mit
- Created: 2018-09-15T09:10:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T02:28:26.000Z (over 2 years ago)
- Last Synced: 2025-03-15T00:37:11.231Z (3 months ago)
- Topics: console, logging, rxjs
- Language: JavaScript
- Homepage:
- Size: 465 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rxjslog
Log RxJS events nicely to the console.
The `next`, `error` and `complete` events have their own icon and
the log messages have their own color so they stand out between
the other log messages.Rxjslog works in both the browser as in Node.js environments.
## Install
```sh
npm install rxjslog
```## Example code
```javascript
import {interval} from 'rxjs';
import {take} from 'rxjs/operators';import {log} from "rxjslog";
const myObservable = interval(500).pipe(take(3));
myObservable.pipe(log("myObservable"))
.subscribe();
```## Example output

## Configuration
You can configure the icons and colors used.
For the `next`, `error` and complete `complete` log messages,
you can set the `icon` and `color`.To stay compatible with Node.js log messages, use only one of these colors:
black, red, green, yellow, blue, magenta, cyan and white.Example:
```
import {logConfig} from "rxjslog";logConfig({ error: { icon: "❗", color: "red" } });
```## License
Rxjslog is written by Edwin Martin and is published under the MIT license.