@rxtk/logs

0.0.0 • Public • Published

@rxtk/logs

Getting started

npm i @rxtk/logs
yarn add @rxtk/logs

API

logger

import logger from '@rxtk/logs';

// Log info
const data = {foo: 'bar'};
logger.info('an info message', data);
logger.debug('a debug message', data);

// Log an error
const err = new Error('ruh roh');
logger.error(err.message, {stack: err.stack, ...data});

toLog

import {of} from 'rxjs';
import logger from '@rxtk/logs';

const input$ = of(...[{data: 'foo'}, {data:'bar'}]);
input$.pipe(logger.toLog('somelabel'));
input$.subscribe(); // will log the values of each item emitted with the provided label

trace

import {throwError} from 'rxjs';
import logger from '@rxtk/logs';

const err = new Error('zoinks!');
const input$ = throwError(err);
input$.pipe(logger.trace());
input$.subscribe(); // will log any errors emitted including their stack trace

Readme

Keywords

none

Package Sidebar

Install

npm i @rxtk/logs

Weekly Downloads

0

Version

0.0.0

License

MIT

Unpacked Size

22.2 kB

Total Files

16

Last publish

Collaborators

  • bfla