Browse Source

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>
process-exit-stdio-flushing
Minwoo Jung 9 years ago
committed by James M Snell
parent
commit
d01eb6882f
  1. 2
      lib/internal/util.js
  2. 3
      test/sequential/test-deprecation-flags.js

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

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

Loading…
Cancel
Save