11'use strict' ;
22
3- const internalUtil = require ( 'internal/util' ) ;
43const util = require ( 'util' ) ;
54const path = require ( 'path' ) ;
65const net = require ( 'net' ) ;
@@ -11,6 +10,11 @@ const inherits = util.inherits;
1110const assert = require ( 'assert' ) ;
1211const spawn = require ( 'child_process' ) . spawn ;
1312const Buffer = require ( 'buffer' ) . Buffer ;
13+ const prefix = `(${ process . release . name } :${ process . pid } ) ` ;
14+
15+ function error ( msg ) {
16+ console . error ( `${ prefix } ${ msg } ` ) ;
17+ }
1418
1519exports . start = function ( argv , stdin , stdout ) {
1620 argv || ( argv = process . argv . slice ( 2 ) ) ;
@@ -32,8 +36,8 @@ exports.start = function(argv, stdin, stdout) {
3236 stdin . resume ( ) ;
3337
3438 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.' ) ;
3741 console . error ( e . message ) ;
3842 console . error ( e . stack ) ;
3943 if ( interface_ . child ) interface_ . child . kill ( ) ;
@@ -521,7 +525,7 @@ Client.prototype.mirrorObject = function(handle, depth, cb) {
521525 cb = cb || function ( ) { } ;
522526 this . reqLookup ( propertyRefs , function ( err , res ) {
523527 if ( err ) {
524- internalUtil . error ( 'problem with reqLookup' ) ;
528+ error ( 'problem with reqLookup' ) ;
525529 cb ( null , handle ) ;
526530 return ;
527531 }
@@ -1672,7 +1676,7 @@ Interface.prototype.trySpawn = function(cb) {
16721676 process . _debugProcess ( pid ) ;
16731677 } catch ( e ) {
16741678 if ( e . code === 'ESRCH' ) {
1675- internalUtil . error ( `Target process: ${ pid } doesn't exist.` ) ;
1679+ error ( `Target process: ${ pid } doesn't exist.` ) ;
16761680 process . exit ( 1 ) ;
16771681 }
16781682 throw e ;
@@ -1741,7 +1745,7 @@ Interface.prototype.trySpawn = function(cb) {
17411745 function connectError ( ) {
17421746 // If it's failed to connect 10 times then print failed message
17431747 if ( connectionAttempts >= 10 ) {
1744- internalUtil . error ( ' failed to connect, please retry' ) ;
1748+ error ( ' failed to connect, please retry' ) ;
17451749 process . exit ( 1 ) ;
17461750 }
17471751 setTimeout ( attemptConnect , 500 ) ;
0 commit comments