Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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