@@ -16,14 +16,18 @@ import { logger } from './logging';
1616 * @param message The message to show.
1717 * @param options.outputLogger The output logger that will receive the message
1818 * @param options.items A set of items that will be rendered as actions in the message.
19+ * @param options.fullMessage An alternate message that is added to the log, but not displayed
20+ * in the popup. This is useful for adding extra detail to the logs
21+ * that would be too noisy for the popup.
1922 *
2023 * @return A promise that resolves to the selected item or undefined when being dismissed.
2124 */
2225export async function showAndLogErrorMessage ( message : string , {
2326 outputLogger = logger ,
24- items = [ ] as string [ ]
27+ items = [ ] as string [ ] ,
28+ fullMessage = undefined as ( string | undefined )
2529} = { } ) : Promise < string | undefined > {
26- return internalShowAndLog ( message , items , outputLogger , Window . showErrorMessage ) ;
30+ return internalShowAndLog ( message , items , outputLogger , Window . showErrorMessage , fullMessage ) ;
2731}
2832/**
2933 * Show a warning message and log it to the console
@@ -58,10 +62,15 @@ export async function showAndLogInformationMessage(message: string, {
5862
5963type ShowMessageFn = ( message : string , ...items : string [ ] ) => Thenable < string | undefined > ;
6064
61- async function internalShowAndLog ( message : string , items : string [ ] , outputLogger = logger ,
62- fn : ShowMessageFn ) : Promise < string | undefined > {
65+ async function internalShowAndLog (
66+ message : string ,
67+ items : string [ ] ,
68+ outputLogger = logger ,
69+ fn : ShowMessageFn ,
70+ fullMessage ?: string
71+ ) : Promise < string | undefined > {
6372 const label = 'Show Log' ;
64- outputLogger . log ( message ) ;
73+ outputLogger . log ( fullMessage || message ) ;
6574 const result = await fn ( message , label , ...items ) ;
6675 if ( result === label ) {
6776 outputLogger . show ( ) ;
0 commit comments