From 12876f8964a3afb3639b7a02882a077b269fb3e6 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Tue, 26 Sep 2023 20:36:04 +0100 Subject: [PATCH] Remove console logging from app.js Signed-off-by: Fred Boniface --- app.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app.js b/app.js index 3f2d472..951f355 100644 --- a/app.js +++ b/app.js @@ -2,12 +2,10 @@ // Please see the included LICENSE file -console.log("Initialising OwlBoard"); const mode = process.env.NODE_ENV || "development"; // Logging const logger = require("./src/utils/logger.utils"); -const pino = require("pino-http"); logger.logger.info("Logger Initialised"); // External Requires @@ -60,7 +58,7 @@ app.disable('x-powered-by'); // Express Error Handling: app.use((err, req, res, next) => { const statusCode = err.statuscode || 500; - console.error(err.message, err.stack); + logger.logger.error(err, "Express Error") res.status(statusCode).json({ message: err.message }); return; }); @@ -75,7 +73,6 @@ app.use(express.json()); //JSON Parsing for POST Requests app.use(compression()); // Compress API Data if supported by client app.use(limiter); app.use(authenticate); -app.use(pino); // 2023 Rationalisation Routes (/api/v2, /misc) app.use("/api/v2/pis", pis2Rtr); // API Version 2