Can't use custom messageFormat function
lis355 opened this issue · comments
I want to use own formatter, it described in manual https://github.com/pinojs/pino-pretty#options
import pino from "pino";
export default pino(pino.transport({
targets: [
{
target: "pino-pretty",
options: {
colorize: true,
ignore: "pid,hostname",
messageFormat: (log, messageKey, levelLabel) => {
return "";
}
}
}
]
}));
I had this error
node:internal/per_context/domexception:53
ErrorCaptureStackTrace(this);
^
Waiting for the debugger to disconnect...
DOMException [DataCloneError]: (log, messageKey, levelLabel) => {
return "";
} could not be cloned.
at new DOMException (node:internal/per_context/domexception:53:5)
at new Worker (node:internal/worker:266:17)
at createWorker (C:\Programming\JS\diarybot\Code\node_modules\thread-stream\index.js:55:18)
at new ThreadStream (C:\Programming\JS\diarybot\Code\node_modules\thread-stream\index.js:230:19)
at buildStream (C:\Programming\JS\diarybot\Code\node_modules\pino\lib\transport.js:21:18)
at Function.transport (C:\Programming\JS\diarybot\Code\node_modules\pino\lib\transport.js:114:10)
at file:///C:/Programming/JS/diarybot/Code/tools/logger.js:3:26
at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:308:24)
at async loadESM (node:internal/process/esm_loader:42:7)