🎚️ chore: Update Logging Levels for Conversations and Messages (#3415)

This commit is contained in:
Danny Avila 2024-07-21 13:54:47 -04:00 committed by GitHub
parent 0bd59c0efe
commit e5dfa06e6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 6 deletions

View file

@ -29,7 +29,7 @@ module.exports = {
saveConvo: async (req, { conversationId, newConversationId, ...convo }, metadata) => {
try {
if (metadata && metadata?.context) {
logger.info(`[saveConvo] ${metadata.context}`);
logger.debug(`[saveConvo] ${metadata.context}`);
}
const messages = await getMessages({ conversationId }, '_id');
const update = { ...convo, messages, user: req.user.id };
@ -49,6 +49,9 @@ module.exports = {
return conversation.toObject();
} catch (error) {
logger.error('[saveConvo] Error saving conversation', error);
if (metadata && metadata?.context) {
logger.info(`[saveConvo] ${metadata.context}`);
}
return { message: 'Error saving conversation' };
}
},