How to use the info function from pino

Find comprehensive JavaScript pino.info code examples handpicked from public code repositorys.

5
6
7
8
9
10
11
12
13
14
const pino = require('pino')({
  extreme: true
})

function handle (req, res) {
  pino.info(req)
  res.end('hello world')
}

server.listen(3000)
fork icon26
star icon91
watch icon3

15
16
17
18
19
20
21
22
23
const app = new Koa()

app.use(rTracer.koaMiddleware())

app.use(async (ctx) => {
  logger.info('Starting request handling')
  const result = await fakeDbAccess()
  ctx.body = result
})
fork icon23
star icon296
watch icon8

+ 8 other calls in file

138
139
140
141
142
143
144
145
146
147
const matcher = new CIDRMatcher(cidrs);

srf.connect({host: process.env.DRACHTIO_HOST, port: process.env.DRACHTIO_PORT, secret: process.env.DRACHTIO_SECRET });
srf.on('connect', (err, hp) => {
  if (err) return this.logger.error({err}, 'Error connecting to drachtio server');
  logger.info(`connected to drachtio listening on ${hp}`);

  const hostports = hp.split(',');
  for (const hp of hostports) {
    const arr = /^(.*)\/(.*):(\d+)$/.exec(hp);
fork icon12
star icon2
watch icon0

+ 16 other calls in file

57
58
59
60
61
62
63
64
65
66
let dir = path.join(pluginFolder, files, filename);
if (fs.existsSync(dir)) {
  if (dir in require.cache) {
    delete require.cache[dir];
    if (fs.existsSync(dir))
      logger.info(`re - require plugin '${filename}'`);
    else {
      logger.warn(`deleted plugin '${filename}'`);
      return delete global.plugins[filename];
    }
fork icon0
star icon0
watch icon0

+ 3 other calls in file

11
12
13
14
15
16
17
18
19
20
21
/* the sleep promise */
var sleep = require('sleep-promise');


/* the /health endpoint */
function health(req, res) {
  log.info('/health (' + req.method + ')');
  return res.status(200).send('OK');
}
exports.health = health;

fork icon0
star icon0
watch icon0

+ 13 other calls in file

6
7
8
9
10
11
12
13
14
15
try {
    mongoClient = new MongoClient(uri, {
        useNewUrlParser: true,
        useUnifiedTopology: true,
    })
    logger.info('STATE: Connecting to MongoDB')
    await mongoClient.connect()
    logger.info('STATE: Successfully connected to MongoDB')
    return mongoClient
} catch (error) {
fork icon0
star icon0
watch icon0