fix: Vervang console met logger

This commit is contained in:
Tibo De Peuter 2025-03-12 14:47:06 +01:00
parent 86dadeae81
commit 8f5b625cc3
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
4 changed files with 25 additions and 6 deletions

View file

@ -2,6 +2,9 @@ import { fetchWithLogging } from '../../util/apiHelper.js';
import { DWENGO_API_BASE } from '../../config.js';
import { LearningPath, LearningPathResponse } from '../../interfaces/learning-content.js';
import { LearningPathProvider } from './learning-path-provider';
import {getLogger, Logger} from "../../logging/initalize";
const logger: Logger = getLogger();
const dwengoApiLearningPathProvider: LearningPathProvider = {
async fetchLearningPaths(hruids: string[], language: string, source: string): Promise<LearningPathResponse> {
@ -20,7 +23,7 @@ const dwengoApiLearningPathProvider: LearningPathProvider = {
const learningPaths = await fetchWithLogging<LearningPath[]>(apiUrl, `Learning paths for ${source}`, { params });
if (!learningPaths || learningPaths.length === 0) {
console.error(`⚠️ WARNING: No learning paths found for ${source}.`);
logger.warn(`⚠️ WARNING: No learning paths found for ${source}.`);
return {
success: false,
source,