From 5a7936aac45570521989d2fb351ba28a8a98455f Mon Sep 17 00:00:00 2001 From: Arash Date: Tue, 30 Jan 2024 08:50:40 -0700 Subject: [PATCH] fix: replace consola with logger --- src/runtime/server/services/connection.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/runtime/server/services/connection.ts b/src/runtime/server/services/connection.ts index f9b2ae7..7fa5197 100644 --- a/src/runtime/server/services/connection.ts +++ b/src/runtime/server/services/connection.ts @@ -1,5 +1,6 @@ import type { ConnectOptions } from 'mongoose' -import { logger } from '@nuxt/kit' +import { consola } from 'consola' +import { colors } from 'consola/utils' import mongoose from 'mongoose' // @ts-ignore @@ -12,9 +13,9 @@ export async function defineMongooseConnection({ uri, options }: { uri?: string; try { await mongoose.connect(mongooseUri, { ...mongooseOptions }) - logger.success('Connected to `MongoDB`') + consola.success('Connected to MongoDB') } catch (err) { - logger.error('Error connecting to `MongoDB`', err) + consola.error(colors.red(`Error connecting to MongoDB: ${err}`)) } }