Skip to content

Commit abe6dad

Browse files
authored
fix: console.error instead of console.log (#35)
* fix: console.error instead of console.log
1 parent 609c9a9 commit abe6dad

File tree

19 files changed

+32
-16
lines changed

19 files changed

+32
-16
lines changed

lib/cli/commands/show.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async function printModule (module, depth, argv) {
1818
const flattenedSupportInfo = supportInfo.contents.toString().replace(/\n/g, '').replace(/\s+/g, ' ');
1919
console.log(`${' '.repeat(2 * (depth + 1))}${moduleInfo} - ${flattenedSupportInfo}`);
2020
} else if (supportInfo.error) {
21-
console.log(`${' '.repeat(2 * (depth + 1))}${moduleInfo} - failed to fetch - ${supportInfo.url}`);
21+
console.error(`${' '.repeat(2 * (depth + 1))}${moduleInfo} - failed to fetch - ${supportInfo.url}`);
2222
} else {
2323
console.log(`${' '.repeat(2 * (depth + 1))}${moduleInfo} - ${supportInfo.url}`);
2424
}

lib/cli/commands/validate.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ module.exports = function (opts) {
2626
if ((supportData === false) || supportData) {
2727
// first validate that the supportData is correct
2828
if ((supportData !== true) && !(typeof supportData === 'string') && !(supportData instanceof Object)) {
29-
console.log(errorInSupportElement);
30-
console.log('Support element should either be true or an Object matching the required schema');
29+
console.error(errorInSupportElement);
30+
console.error('Support element should either be true or an Object matching the required schema');
3131
return;
3232
}
3333

3434
try {
3535
support.validateSupportElement({ support: supportData }, true);
3636
} catch (e) {
37-
console.log(errorInSupportElement);
38-
console.log(e.prettyValidationErrors);
37+
console.error(errorInSupportElement);
38+
console.error(e.prettyValidationErrors);
3939
return;
4040
}
4141

@@ -55,18 +55,18 @@ module.exports = function (opts) {
5555
return;
5656
}
5757
} catch (e) {
58-
console.log('Error in support JSON');
59-
console.log(e.prettyValidationErrors);
58+
console.error('Error in support JSON');
59+
console.error(e.prettyValidationErrors);
6060
}
6161
} catch (e) {
62-
console.log('Your support information is not properly formed');
63-
console.log(e.message);
62+
console.error('Your support information is not properly formed');
63+
console.error(e.message);
6464
}
6565
} else {
66-
console.log('support info not resolved: ' + supportData.url);
66+
console.error('support info not resolved: ' + supportData.url);
6767
}
6868
} else {
69-
console.log('no support info');
69+
console.error('no support info');
7070
}
7171
}
7272
};

0 commit comments

Comments
 (0)