diff --git a/.eslintrc.js b/.eslintrc.js index 85b46cb..ef0f9e0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,7 +17,7 @@ module.exports = { sourceType: 'module', }, rules: { - 'no-console': 'error', + 'no-console': 'warn', 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'import/extensions': 'off', camelcase: ['error', { properties: 'never', ignoreDestructuring: true }], diff --git a/server/src/utils/quest.js b/server/src/utils/quest.js index 5b8a3fc..d11f415 100644 --- a/server/src/utils/quest.js +++ b/server/src/utils/quest.js @@ -3,6 +3,7 @@ import path from 'path' import yaml from 'yaml' import { Quest } from '@linux-odyssey/models' +import logger from './logger' const questDirectory = path.join(process.cwd(), '..', 'quests') @@ -50,7 +51,7 @@ export function loadAndUpdateQuests() { } ) } catch (error) { - console.error(`Error parsing quest ${id}:`, error) + logger.error(`Error parsing quest ${id}:`, error) throw error } }) diff --git a/server/src/utils/setupTest.js b/server/src/utils/setupTest.js index 5369d4c..6a59a5c 100644 --- a/server/src/utils/setupTest.js +++ b/server/src/utils/setupTest.js @@ -1,9 +1,10 @@ import { User } from '@linux-odyssey/models' import config from '../config.js' import { createUser } from '../models/userManager.js' +import logger from './logger.js' export default async function setupTest() { - console.log('Setting up test account') + logger.info('Setting up test account') if (!(config.testing.username && config.testing.password)) { throw new Error( 'No testing account found! Please set TESTING_USERNAME and TESTING_PASSWORD in .env' @@ -13,10 +14,10 @@ export default async function setupTest() { const email = `${username}@example.com` if (await User.exists({ username })) { - console.log('Testing account already exists') + logger.info('Testing account already exists') return } await createUser(username, email, { password }) - console.log('Created testing account') + logger.info('Created testing account') }