Skip to content

Commit

Permalink
add log for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Jeanneney committed Mar 29, 2024
1 parent 524a9e0 commit 9e6b0d0
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions packages/generic/backend/src/lib/annotator/buildAnnotator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ function buildAnnotator(
);
logger.log({
operationName: 'annotateDocumentsWithoutAnnotations',
msg: `Annotating with ${
annotatorConfig.name
} : ${documentsAnnotatedCount}/${documentsCountToAnnotate}... ${formatDocumentInfos(
currentDocumentToAnnotate,
)}`,
msg: `Annotating with ${annotatorConfig.name

Check failure on line 118 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Insert `⏎············`

Check failure on line 118 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Insert `⏎············`
} : ${documentsAnnotatedCount}/${documentsCountToAnnotate}... ${formatDocumentInfos(

Check failure on line 119 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Delete `··`

Check failure on line 119 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Delete `··`
currentDocumentToAnnotate,

Check failure on line 120 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Delete `··`

Check failure on line 120 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Delete `··`
)}`,

Check failure on line 121 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Delete `··`

Check failure on line 121 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Delete `··`
});
try {
await annotateDocument(updatedDocument);
Expand Down Expand Up @@ -189,6 +188,33 @@ function buildAnnotator(
msg: 'NLP annotation succeeded',
});

logger.error({
operationName: 'annotateDocumentDebug',
msg: `annotations : ${annotations.toString()}`,
});

logger.error({
operationName: 'annotateDocumentDebug',
msg: `newCategoriesToOmit : ${newCategoriesToOmit}`,
});

logger.error({
operationName: 'annotateDocumentDebug',
msg: `computedAdditionalTerms.additionalTermsToAnnotate : ${computedAdditionalTerms?.additionalTermsToAnnotate}`,
});

logger.error({
operationName: 'annotateDocumentDebug',
msg: `computedAdditionalTerms.additionalTermsToUnAnnotate : ${computedAdditionalTerms?.additionalTermsToUnAnnotate}`,
});

logger.error({
operationName: 'annotateDocumentDebug',
msg: `additionalTermsParsingFailed : ${additionalTermsParsingFailed}`,
});


Check failure on line 216 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Delete `⏎⏎`

Check failure on line 216 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Delete `⏎⏎`

if (document.route == 'simple' && annotations.length == 0) {
await documentService.updateDocumentRoute(documentId, 'automatic');
logger.log({
Expand Down Expand Up @@ -287,8 +313,7 @@ function buildAnnotator(
}

function formatDocumentInfos(document: documentType) {
return `[${idModule.lib.convertToString(document._id)} ${document.source} ${
document.documentNumber
}]`;
return `[${idModule.lib.convertToString(document._id)} ${document.source} ${document.documentNumber

Check failure on line 316 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Insert `⏎······`

Check failure on line 316 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Insert `⏎······`
}]`;

Check failure on line 317 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Delete `··`

Check failure on line 317 in packages/generic/backend/src/lib/annotator/buildAnnotator.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Delete `··`
}
}

0 comments on commit 9e6b0d0

Please sign in to comment.