From d7534bf7b8c4da149b75d7a52f01f6e76d50f60b Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 30 Dec 2018 19:44:13 -0500 Subject: [PATCH] coverage: use process._rawDebug() during setup console is not ready to use at this point in the bootstrapping process, so switch to process._rawDebug() instead. PR-URL: https://github.com/nodejs/node/pull/25289 Fixes: https://github.com/nodejs/node/issues/25287 Reviewed-By: Anna Henningsen Reviewed-By: Gus Caplan Reviewed-By: Yuta Hiroto Reviewed-By: Joyee Cheung Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Backport-PR-URL: https://github.com/nodejs/node/pull/25496 --- lib/internal/process/coverage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/process/coverage.js b/lib/internal/process/coverage.js index 5c5d0c2b6171f3..c84181db933334 100644 --- a/lib/internal/process/coverage.js +++ b/lib/internal/process/coverage.js @@ -53,7 +53,7 @@ exports.writeCoverage = writeCoverage; function setup() { const { Connection } = internalBinding('inspector'); if (!Connection) { - console.warn('inspector not enabled'); + process._rawDebug('inspector not enabled'); return; } @@ -80,7 +80,7 @@ function setup() { coverageDirectory = process.env.NODE_V8_COVERAGE = resolve(process.env.NODE_V8_COVERAGE); } catch (err) { - console.error(err); + process._rawDebug(err.toString()); } }