File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @gitbook/integration-slack ' : patch
3+ ---
4+
5+ Add more logs to the slack integration
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ export async function queryAskAI({
165165 const { environment, api } = context ;
166166
167167 const askText = `_Asking: ${ stripMarkdown ( text ) } _` ;
168- logger . info ( `${ { channelId, teamId, threadId } } -> ${ askText } ` ) ;
168+ logger . info ( `${ askText } ( channelId: ${ channelId } , teamId: ${ teamId } , userId: ${ userId } ) ` ) ;
169169
170170 const { client, installation } = await getInstallationApiClient ( api , teamId ) ;
171171 if ( ! installation ) {
@@ -216,6 +216,8 @@ export async function queryAskAI({
216216 throw new Error ( 'Answer is not in markdown format' ) ;
217217 }
218218
219+ logger . debug ( `Answer has ${ answer . answer . markdown . length } characters` ) ;
220+
219221 const answerText = capitalizeFirstLetter ( answer . answer . markdown ) ;
220222
221223 const relatedSources = await getRelatedSources ( {
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ export async function slackAPI<Result>(
143143 } ) ;
144144
145145 if ( ! response . ok ) {
146- logger . error ( `slack returned an error ${ response . status } : ${ response . statusText } ` ) ;
146+ logger . error ( `API error ${ response . status } : ${ response . statusText } ` ) ;
147147 throw new Error ( `${ response . status } ${ response . statusText } ` ) ;
148148 }
149149
@@ -177,6 +177,7 @@ export async function slackAPI<Result>(
177177 }
178178 }
179179
180+ logger . error ( `Result error: ${ result . error } ` ) ;
180181 throw new Error ( `${ request . method } ${ url . toString ( ) } : ${ result . error } ` ) ;
181182 }
182183
You can’t perform that action at this time.
0 commit comments