File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -22,18 +22,20 @@ function time(start) {
2222
2323function defaultHandler ( request , options , cb ) {
2424 var url = ( typeof options === 'string' ? urlParse ( options ) : options ) . href ;
25+ var method = '[' + options . method + ']' ;
26+ var signature = method + ' ' + url ;
2527 var start = new Date ( ) ;
2628
27- setImmediate ( console . log , chalk . gray ( ' → ' + url ) ) ;
29+ setImmediate ( console . log , chalk . gray ( ' → ' + signature ) ) ;
2830
2931 return request ( options , cb )
3032 . on ( 'response' , function ( response ) {
3133 var status = response . statusCode ;
3234 var s = status / 100 | 0 ;
33- console . log ( ' ' + chalk [ colorCodes [ s ] ] ( status ) + ' ← ' + url + ' ' + chalk . gray ( time ( start ) ) ) ;
35+ console . log ( ' ' + chalk [ colorCodes [ s ] ] ( status ) + ' ← ' + signature + ' ' + chalk . gray ( time ( start ) ) ) ;
3436 } )
3537 . on ( 'error' , function ( err ) {
36- console . log ( ' ' + chalk . red ( 'xxx' ) + ' ← ' + url + ' ' + chalk . red ( err . message ) ) ;
38+ console . log ( ' ' + chalk . red ( 'xxx' ) + ' ← ' + signature + ' ' + chalk . red ( err . message ) ) ;
3739 } ) ;
3840}
3941
You can’t perform that action at this time.
0 commit comments