From 648c72fa34c451bcf088d914b474a11875154b6b Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 28 Sep 2023 12:11:10 +0100 Subject: [PATCH] Migrate pis.services to new logger Signed-off-by: Fred Boniface --- src/services/pis.services.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/services/pis.services.js b/src/services/pis.services.js index eb4615a..2f6b492 100644 --- a/src/services/pis.services.js +++ b/src/services/pis.services.js @@ -1,17 +1,14 @@ // Finds PIS Codes using DB Lookups const db = require("../services/dbAccess.services"); -const log = require("../utils/logs.utils"); const clean = require("../utils/sanitizer.utils"); +import { logger } from "../utils/logger.utils"; + const supported = ["GW", "UK"]; async function findPisByOrigDest(start, end) { - log.out( - "pisServices.findPisByOrigDest: Searching for PIS for Orig: " + - `${start}, Dest: ${end}`, - "dbug" - ); + logger.debug(`pisServices.findPisByOrigDest: Searching for Orig: ${start}, Dest: ${end}`); const firstCrs = clean.cleanApiEndpointTxt(start.toLowerCase()); const lastCrs = clean.cleanApiEndpointTxt(end.toLowerCase()); const query = { @@ -33,7 +30,7 @@ async function findPisByOrigDest(start, end) { } async function findPisByCode(code) { - log.out(`pisServices.findPisByCode: Searching for PIS code: ${code}`, "dbug"); + logger.debug(`pisServices.findPisByCode: Searching for PIS code: ${code}`); const cleanCode = clean.removeNonNumeric(code); const query = { code: parseInt(cleanCode),