I am learning by myself how to use node js express and pino for logger, but What should I do if the logger throws an error? This is my example.
const express = require("express"); const pino = require("pino"); const ApiServerConfig = require("./apiServerConfig"); const logger = pino({ level: ApiServerConfig.IS_PRODUCTION ? 'info' : 'debug', prettyPrint: true, timestamp: true, }) const app = express(); const initApp = () => { app.listen(4000, () => { logger.info("server up in port 4000") // if this function throw error, what should I do? }) } initApp();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)