From d01eb6882fcc1fcb1cfc01b7e474ab2b0e80b73c Mon Sep 17 00:00:00 2001 From: Minwoo Jung Date: Tue, 17 Nov 2015 17:59:30 +0900 Subject: [PATCH] lib: add 'pid' prefix in `internal/util` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR improves `prefix` in `util` that we've agreed on https://github.com/nodejs/node/pull/3833 (separate code for javascript to move the printing function to C++ directly) PR-URL: https://github.com/nodejs/node/pull/3878 Reviewed-By: Colin Ihrig Reviewed-By: Roman Reiss Reviewed-By: Michaƫl Zasso Reviewed-By: James M Snell --- lib/internal/util.js | 2 +- test/sequential/test-deprecation-flags.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/internal/util.js b/lib/internal/util.js index a31f22e6e9..c49dbe93da 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -1,6 +1,6 @@ 'use strict'; -const prefix = '(node) '; +const prefix = `(${process.release.name}:${process.pid}) `; // All the internal deprecations have to use this function only, as this will // prepend the prefix to the actual message. diff --git a/test/sequential/test-deprecation-flags.js b/test/sequential/test-deprecation-flags.js index a243cc44f2..543e368466 100644 --- a/test/sequential/test-deprecation-flags.js +++ b/test/sequential/test-deprecation-flags.js @@ -16,8 +16,7 @@ execFile(node, normal, function(er, stdout, stderr) { console.error('normal: show deprecation warning'); assert.equal(er, null); assert.equal(stdout, ''); - assert.equal(stderr, '(node) util.debug is deprecated. Use console.error ' + - 'instead.\nDEBUG: This is deprecated\n'); + assert(/util\.debug is deprecated/.test(stderr)); console.log('normal ok'); });