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:
parent
ca2e8b292f
commit
d01eb6882f
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'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
|
// All the internal deprecations have to use this function only, as this will
|
||||||
// prepend the prefix to the actual message.
|
// prepend the prefix to the actual message.
|
||||||
|
@ -16,8 +16,7 @@ execFile(node, normal, function(er, stdout, stderr) {
|
|||||||
console.error('normal: show deprecation warning');
|
console.error('normal: show deprecation warning');
|
||||||
assert.equal(er, null);
|
assert.equal(er, null);
|
||||||
assert.equal(stdout, '');
|
assert.equal(stdout, '');
|
||||||
assert.equal(stderr, '(node) util.debug is deprecated. Use console.error ' +
|
assert(/util\.debug is deprecated/.test(stderr));
|
||||||
'instead.\nDEBUG: This is deprecated\n');
|
|
||||||
console.log('normal ok');
|
console.log('normal ok');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user