This commit is contained in:
siyuniu-ms 2024-08-15 17:38:11 -07:00
Родитель 157c18fae8
Коммит 4def759128
3 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -501,10 +501,10 @@ export class AnalyticsPluginTests extends AITestClass {
const prop = baseData.properties;
Assert.equal(-1, JSON.stringify(prop).indexOf("test message"), "log info is not included");
let applelist = new Array(49).fill("apple");
// check maxLength default value
appInsights.config.expCfg.expLog = () => {
return {logs: ['apple', 'apple', 'apple', 'apple', 'pear', 'banana']};
return {logs: applelist.concat(['pear', 'banana'])};
};;
this.clock.tick(1);
appInsights.trackException({error: new Error(), severityLevel: SeverityLevel.Critical});

Просмотреть файл

@ -68,7 +68,7 @@ const defaultValues: IConfigDefaults<IConfig&IConfiguration> = objDeepFreeze({
enableDebug: cfgDfBoolean(),
disableFlushOnBeforeUnload: cfgDfBoolean(),
disableFlushOnUnload: cfgDfBoolean(false, "disableFlushOnBeforeUnload"),
expCfg: cfgDfMerge<IExceptionConfig>({inclScripts: false, expLog: undefined, maxLogs: 5})
expCfg: cfgDfMerge<IExceptionConfig>({inclScripts: false, expLog: undefined, maxLogs: 50})
});
function _chkConfigMilliseconds(value: number, defValue: number): number {

Просмотреть файл

@ -18,7 +18,7 @@ export interface IExceptionConfig{
* @returns {Object} An object with the following property:
* - logs: An array of strings, where each string represents a log entry to be included in the telemetry.
*
* @property {number} maxLogs - Specifies the maximum number of logs that can be generated. If not explicitly set, it defaults to 5.
* @property {number} maxLogs - Specifies the maximum number of logs that can be generated. If not explicitly set, it defaults to 50.
*/
expLog: () => { logs: string[] },
maxLogs: number