How to use the pino-std-serializers.err function in pino-std-serializers

To help you get started, we’ve selected a few pino-std-serializers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pinojs / pino / pino.js View on Github external
streamSym,
  stringifySym,
  stringifiersSym,
  setLevelSym,
  endSym,
  formatOptsSym,
  messageKeySym,
  useLevelLabelsSym,
  changeLevelNameSym,
  mixinSym,
  useOnlyCustomLevelsSym
} = symbols
const { epochTime, nullTime } = time
const { pid } = process
const hostname = os.hostname()
const defaultErrorSerializer = stdSerializers.err
const defaultOptions = {
  level: 'info',
  useLevelLabels: false,
  messageKey: 'msg',
  enabled: true,
  prettyPrint: false,
  base: { pid, hostname },
  serializers: Object.assign(Object.create(null), {
    err: defaultErrorSerializer
  }),
  timestamp: epochTime,
  name: undefined,
  redact: null,
  customLevels: null,
  changeLevelName: 'level',
  useOnlyCustomLevels: false
github pinojs / pino-http / logger.js View on Github external
return logger
}

function reqIdGenFactory (func) {
  if (typeof func === 'function') return func
  var maxInt = 2147483647
  var nextReqId = 0
  return function genReqId (req) {
    return req.id || (nextReqId = (nextReqId + 1) & maxInt)
  }
}

module.exports = pinoLogger
module.exports.stdSerializers = {
  err: serializers.err,
  req: serializers.req,
  res: serializers.res
}
module.exports.startTime = startTime