improvement: moved all console logs to pino

This commit is contained in:
canove
2021-01-07 20:52:51 -03:00
parent 0689b55453
commit 896f122cf7
16 changed files with 57 additions and 36 deletions

View File

@@ -37,7 +37,6 @@ export const GetWbotMessage = async (
return msgFound;
} catch (err) {
console.log(err);
throw new AppError("ERR_FETCH_WAPP_MSG");
}
};

View File

@@ -1,6 +1,7 @@
import { getIO } from "../libs/socket";
import Message from "../models/Message";
import Ticket from "../models/Ticket";
import { logger } from "../utils/logger";
import GetTicketWbot from "./GetTicketWbot";
const SetTicketMessagesAsRead = async (ticket: Ticket): Promise<void> => {
@@ -18,9 +19,8 @@ const SetTicketMessagesAsRead = async (ticket: Ticket): Promise<void> => {
const wbot = await GetTicketWbot(ticket);
wbot.sendSeen(`${ticket.contact.number}@${ticket.isGroup ? "g" : "c"}.us`);
} catch (err) {
console.log(
"Could not mark messages as read. Maybe whatsapp session disconnected?",
err
logger.warn(
`Could not mark messages as read. Maybe whatsapp session disconnected? Err: ${err}`
);
}