Skip to content

Commit

Permalink
Changed log structure to fit the rest of the bot
Browse files Browse the repository at this point in the history
  • Loading branch information
jonarango committed Oct 23, 2024
1 parent 2dfb272 commit 20d99a6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/plugins/mongodb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export default {
const db_url = `mongodb://${process.env.MONGO_HOST}:${process.env.MONGO_PORT}`;
const db_name = process.env.MONGO_DB;

log.info(`[MongoDB] | Connecting to ${db_url}/${db_name} ...`);

log.debug(`mongodb - Connecting to ${db_url}/${db_name} ...`);

mongoose.connect(`${db_url}/${db_name}`, { });
const db = mongoose.connection;
Expand All @@ -35,11 +34,11 @@ export default {
});

db.once('open', async () => {
log.info(`[MongoDB] | Connected to ${db_url}/${db_name}`);
log.info(`mongodb - Connected to ${db_url}/${db_name}`);

const collections = await mongoose.connection.db?.listCollections().toArray();

log.info(`[MongoDB] | Found ${collections?.length} collections defined.`)
log.info(`mongodb - Found ${collections?.length} collections defined.`)
});

// You should return the database connection and the models you want to use
Expand Down

0 comments on commit 20d99a6

Please sign in to comment.