From e96cd250075af8ad4088a251a795cc8b13148531 Mon Sep 17 00:00:00 2001 From: Marco Ippolito Date: Tue, 31 Oct 2023 13:04:21 +0200 Subject: [PATCH] util: runtime deprecate util.log fix pr url PR-URL: https://github.com/nodejs/node/pull/50488 Reviewed-By: Rafael Gonzaga Reviewed-By: Yagiz Nizipli Reviewed-By: Robert Nagy Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Joyee Cheung --- doc/api/deprecations.md | 5 ++++- lib/util.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index d3b8844d5acdc2..a39728b6e5b9a8 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -1313,6 +1313,9 @@ The [`util.isUndefined()`][] API is deprecated. -Type: Documentation-only +Type: Runtime The [`util.log()`][] API is deprecated. diff --git a/lib/util.js b/lib/util.js index fbcacfa8228655..0e8a79d2b35eae 100644 --- a/lib/util.js +++ b/lib/util.js @@ -446,7 +446,10 @@ module.exports = { 'Please use `arg === null || ' + '(typeof arg !== "object" && typeof arg !== "function")` instead.', 'DEP0054'), - log: deprecate(log, 'The `util.log API is deprecated.', 'DEP0059'), + log: deprecate(log, + 'The `util.log API is deprecated. ' + + 'Please use console.log() with a custom formatter or a third-party logger instead.', + 'DEP0059'), promisify, stripVTControlCharacters, toUSVString,