Skip to content

Commit

Permalink
cap depth at 12
Browse files Browse the repository at this point in the history
  • Loading branch information
Hweinstock committed Nov 12, 2024
1 parent 09a3b36 commit 5c2cab2
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { uiEventRecorder } from '../../../amazonq/util/eventRecorder'
import { globals } from '../../../shared'
import { telemetry } from '../../../shared/telemetry'
import { isSsoConnection } from '../../../auth/connection'
import * as util from 'util'

export interface ChatControllerMessagePublishers {
readonly processPromptChatMessage: MessagePublisher<PromptMessage>
Expand Down Expand Up @@ -650,9 +651,8 @@ export class ChatController {

const request = triggerPayloadToChatRequest(triggerPayload)
const session = this.sessionStorage.getSession(tabID)
//eslint-disable-next-line aws-toolkits/no-json-stringify-in-log
getLogger().info(
`request from tab: ${tabID} conversationID: ${session.sessionIdentifier} request: ${JSON.stringify(request)}`
`request from tab: ${tabID} conversationID: ${session.sessionIdentifier} request: ${util.inspect(request, { depth: 12 })}`
)
let response: MessengerResponseType | undefined = undefined
session.createNewTokenSource()
Expand All @@ -675,11 +675,10 @@ export class ChatController {
this.telemetryHelper.recordEnterFocusConversation(triggerEvent.tabID)
this.telemetryHelper.recordStartConversation(triggerEvent, triggerPayload)

//eslint-disable-next-line aws-toolkits/no-json-stringify-in-log
getLogger().info(
`response to tab: ${tabID} conversationID: ${session.sessionIdentifier} requestID: ${
response.$metadata.requestId
} metadata: ${JSON.stringify(response.$metadata)}`
} metadata: ${util.inspect(response.$metadata, { depth: 12 })}`
)
await this.messenger.sendAIResponse(response, session, tabID, triggerID, triggerPayload)
} catch (e: any) {
Expand Down

0 comments on commit 5c2cab2

Please sign in to comment.