CoolFace
Apppublic

strong-tie/inbound-calls

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
basic.js44 linesDownload Raw Back to examples
1'use strict'2 3// Pino's primary usage writes ndjson to `stdout`:4const pino = require('..')()5 6// However, if "human readable" output is desired,7// `pino-pretty` can be provided as the destination8// stream by uncommenting the following line in place9// of the previous declaration:10// const pino = require('..')(require('pino-pretty')())11 12pino.info('hello world')13pino.error('this is at error level')14pino.info('the answer is %d', 42)15pino.info({ obj: 42 }, 'hello world')16pino.info({ obj: 42, b: 2 }, 'hello world')17pino.info({ nested: { obj: 42 } }, 'nested')18setImmediate(() => {19  pino.info('after setImmediate')20})21pino.error(new Error('an error'))22 23const child = pino.child({ a: 'property' })24child.info('hello child!')25 26const childsChild = child.child({ another: 'property' })27childsChild.info('hello baby..')28 29pino.debug('this should be mute')30 31pino.level = 'trace'32 33pino.debug('this is a debug statement')34 35pino.child({ another: 'property' }).debug('this is a debug statement via child')36pino.trace('this is a trace statement')37 38pino.debug('this is a "debug" statement with "')39 40pino.info(new Error('kaboom'))41pino.info(null)42 43pino.info(new Error('kaboom'), 'with', 'a', 'message')44