Skip to content

Commit 4ed5ac5

Browse files
committed
feat(logs): Refactor logs for annotation_exporter
1 parent 8cc61fd commit 4ed5ac5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

core/lib/annotation_exporter.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const glob = require('glob');
44
const fs = require('fs-extra');
55
const _ = require('lodash');
66
const mp = require('./markdown_parser');
7+
const logger = require('./log');
78

89
const annotations_exporter = function (pl) {
910

@@ -18,9 +19,7 @@ const annotations_exporter = function (pl) {
1819
try {
1920
oldAnnotations = fs.readFileSync(path.resolve(paths.source.annotations, 'annotations.js'), 'utf8');
2021
} catch (ex) {
21-
if (pl.config.debug) {
22-
console.log('annotations.js file missing from ' + paths.source.annotations + '. This may be expected.');
23-
}
22+
logger.debug(`annotations.js file missing from ${paths.source.annotations}. This may be expected if you do not use annotations or are using markdown.`);
2423
return [];
2524
}
2625

@@ -31,8 +30,7 @@ const annotations_exporter = function (pl) {
3130
try {
3231
var oldAnnotationsJSON = JSON.parse(oldAnnotations);
3332
} catch (ex) {
34-
console.log('There was an error parsing JSON for ' + paths.source.annotations + 'annotations.js');
35-
console.log(ex);
33+
logger.error(`There was an error parsing JSON for ${paths.source.annotations}annotations.js`);
3634
return [];
3735
}
3836
return oldAnnotationsJSON.comments;

0 commit comments

Comments
 (0)