importloggerfrom'@rxtk/logs';// Log infoconstdata={foo: 'bar'};logger.info('an info message',data);logger.debug('a debug message',data);// Log an errorconsterr=newError('ruh roh');logger.error(err.message,{stack: err.stack, ...data});
toLog
import{of}from'rxjs';importloggerfrom'@rxtk/logs';constinput$=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';importloggerfrom'@rxtk/logs';consterr=newError('zoinks!');constinput$=throwError(err);input$.pipe(logger.trace());input$.subscribe();// will log any errors emitted including their stack trace