Skip to content

Commit ef72c19

Browse files
committed
use console.warn/info where appropriate
Change info to use console.info and warn function to use console.warn, this not only makes sense semantically but also in practice server side runtimes like deno write console.log to stdout, and console.warn/info to stderr, this is important because logging to stdout can break some cli apps.
1 parent 5b7f9ca commit ef72c19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shared/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,15 @@ function getVerbosityLevel() {
374374
function info(msg) {
375375
if (verbosity >= VerbosityLevel.INFOS) {
376376
// eslint-disable-next-line no-console
377-
console.log(`Info: ${msg}`);
377+
console.info(`Info: ${msg}`);
378378
}
379379
}
380380

381381
// Non-fatal warnings.
382382
function warn(msg) {
383383
if (verbosity >= VerbosityLevel.WARNINGS) {
384384
// eslint-disable-next-line no-console
385-
console.log(`Warning: ${msg}`);
385+
console.warn(`Warning: ${msg}`);
386386
}
387387
}
388388

0 commit comments

Comments
 (0)