@@ -38,6 +38,7 @@ import { AuthUtil } from '../util/authUtil'
38
38
import { CodeWhispererUserGroupSettings } from '../util/userGroupUtil'
39
39
import { CWInlineCompletionItemProvider } from './inlineCompletionItemProvider'
40
40
import { application } from '../util/codeWhispererApplication'
41
+ import { indent } from '../../shared/utilities/textUtilities'
41
42
42
43
/**
43
44
* This class is for getRecommendation/listRecommendation API calls and its states
@@ -270,8 +271,9 @@ export class RecommendationHandler {
270
271
}
271
272
} finally {
272
273
const timezone = Intl . DateTimeFormat ( ) . resolvedOptions ( ) . timeZone
273
- getLogger ( ) . debug (
274
- `Request ID: ${ requestId } ,
274
+
275
+ let msg = indent (
276
+ `codewhisperer: request-id: ${ requestId } ,
275
277
timestamp(epoch): ${ Date . now ( ) } ,
276
278
timezone: ${ timezone } ,
277
279
datetime: ${ new Date ( ) . toLocaleString ( [ ] , { timeZone : timezone } ) } ,
@@ -281,12 +283,16 @@ export class RecommendationHandler {
281
283
left context of line: '${ session . leftContextOfCurrentLine } ',
282
284
line number: ${ session . startPos . line } ,
283
285
character location: ${ session . startPos . character } ,
284
- latency: ${ latency } ms.`
285
- )
286
- getLogger ( ) . verbose ( 'Recommendations:' )
286
+ latency: ${ latency } ms.
287
+ Recommendations:` ,
288
+ 4 ,
289
+ true
290
+ ) . trimStart ( )
287
291
recommendations . forEach ( ( item , index ) => {
288
- getLogger ( ) . verbose ( `[ ${ index } ]\n ${ item . content . trimRight ( ) } `)
292
+ msg += `\n ${ index . toString ( ) . padStart ( 2 , '0' ) } : ${ indent ( item . content , 8 , true ) . trim ( ) } `
289
293
} )
294
+ getLogger ( ) . debug ( msg )
295
+
290
296
if ( invocationResult === 'Succeeded' ) {
291
297
CodeWhispererCodeCoverageTracker . getTracker ( session . language ) ?. incrementServiceInvocationCount ( )
292
298
}
0 commit comments