Skip to content

Fix error not logged

Florent requested to merge fflorent/search-index:fix-errors-log-not-shown into master

Fixes #46 (closed)

Pino seems to log the error with the callstack when the error is passed as the first argument.

Create a js file at the root of the project to test that:

const {logger} = require('./dist/server/helpers/logger')

logger.error({error: new Error('test')}, 'does not work')
logger.error('does not work either', {err: new Error('test')})
logger.error({err: new Error('test')}, 'works!')
logger.error(new Error('test'), 'works as well!')
Edited by Florent

Merge request reports