Skip to content

Commit

Permalink
Use logger instead of console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislaw-zakrzewski committed Apr 3, 2024
1 parent 8f442de commit 9985787
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions data-serving/data-service/src/controllers/preprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { CaseRevision } from '../model/case-revision';
import { Query } from 'mongoose';
import _ from 'lodash';

import { logger } from '../util/logger';

export const getCase = async (
request: Request,
): Promise<CaseDocument | null> => {
Expand Down Expand Up @@ -253,8 +255,7 @@ export const createBatchDeleteCaseRevisions = async (
lean: true,
});
} catch (err) {
console.log('Failed to insert some case revisions');
console.log(err);
logger.error(`Failed to insert some case revisions: ${err}`);
}

next();
Expand Down Expand Up @@ -283,8 +284,7 @@ export const createBatchUpsertCaseRevisions = async (
lean: true,
});
} catch (err) {
console.log('Failed to insert some case revisions');
console.log(err);
logger.error(`Failed to insert some case revisions: ${err}`);
}

next();
Expand Down Expand Up @@ -319,8 +319,7 @@ export const createBatchUpdateCaseRevisions = async (
lean: true,
});
} catch (err) {
console.log('Failed to insert some case revisions');
console.log(err);
logger.error(`Failed to insert some case revisions: ${err}`);
}

next();
Expand Down

0 comments on commit 9985787

Please sign in to comment.