lib: add 'pid' prefix in internal/util

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 <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Minwoo Jung 2015-11-17 17:59:30 +09:00 committed by James M Snell
parent ca2e8b292f
commit d01eb6882f
2 changed files with 2 additions and 3 deletions

View File

@ -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.

View File

@ -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');
});