1
1
'use strict' ;
2
2
3
- const internalUtil = require ( 'internal/util' ) ;
4
3
const util = require ( 'util' ) ;
5
4
const path = require ( 'path' ) ;
6
5
const net = require ( 'net' ) ;
@@ -11,6 +10,11 @@ const inherits = util.inherits;
11
10
const assert = require ( 'assert' ) ;
12
11
const spawn = require ( 'child_process' ) . spawn ;
13
12
const Buffer = require ( 'buffer' ) . Buffer ;
13
+ const prefix = `(${ process . release . name } :${ process . pid } ) ` ;
14
+
15
+ function error ( msg ) {
16
+ console . error ( `${ prefix } ${ msg } ` ) ;
17
+ }
14
18
15
19
exports . start = function ( argv , stdin , stdout ) {
16
20
argv || ( argv = process . argv . slice ( 2 ) ) ;
@@ -32,8 +36,8 @@ exports.start = function(argv, stdin, stdout) {
32
36
stdin . resume ( ) ;
33
37
34
38
process . on ( 'uncaughtException' , function ( e ) {
35
- internalUtil . error ( 'There was an internal error in Node\'s debugger. ' +
36
- 'Please report this bug.' ) ;
39
+ error ( 'There was an internal error in Node\'s debugger. ' +
40
+ 'Please report this bug.' ) ;
37
41
console . error ( e . message ) ;
38
42
console . error ( e . stack ) ;
39
43
if ( interface_ . child ) interface_ . child . kill ( ) ;
@@ -521,7 +525,7 @@ Client.prototype.mirrorObject = function(handle, depth, cb) {
521
525
cb = cb || function ( ) { } ;
522
526
this . reqLookup ( propertyRefs , function ( err , res ) {
523
527
if ( err ) {
524
- internalUtil . error ( 'problem with reqLookup' ) ;
528
+ error ( 'problem with reqLookup' ) ;
525
529
cb ( null , handle ) ;
526
530
return ;
527
531
}
@@ -1672,7 +1676,7 @@ Interface.prototype.trySpawn = function(cb) {
1672
1676
process . _debugProcess ( pid ) ;
1673
1677
} catch ( e ) {
1674
1678
if ( e . code === 'ESRCH' ) {
1675
- internalUtil . error ( `Target process: ${ pid } doesn't exist.` ) ;
1679
+ error ( `Target process: ${ pid } doesn't exist.` ) ;
1676
1680
process . exit ( 1 ) ;
1677
1681
}
1678
1682
throw e ;
@@ -1741,7 +1745,7 @@ Interface.prototype.trySpawn = function(cb) {
1741
1745
function connectError ( ) {
1742
1746
// If it's failed to connect 10 times then print failed message
1743
1747
if ( connectionAttempts >= 10 ) {
1744
- internalUtil . error ( ' failed to connect, please retry' ) ;
1748
+ error ( ' failed to connect, please retry' ) ;
1745
1749
process . exit ( 1 ) ;
1746
1750
}
1747
1751
setTimeout ( attemptConnect , 500 ) ;
0 commit comments