Skip to content

Commit d326960

Browse files
committed
Added ManualStackingInfo
1 parent 464b0f8 commit d326960

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

src/EventBuilder.ts

+28-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ExceptionlessClient } from './ExceptionlessClient';
22
import { IEvent } from './models/IEvent';
33
import { IUserInfo } from './models/IUserInfo';
4+
import { IManualStackingInfo } from './models/IManualStackingInfo';
45
import { ContextData } from './plugins/ContextData';
56
import { EventPluginContext } from './plugins/EventPluginContext';
67
import { Utils } from './Utils';
@@ -111,14 +112,39 @@ export class EventBuilder {
111112
return this;
112113
}
113114

115+
/**
116+
* Changes default stacking behavior by setting manual
117+
* stacking information.
118+
* @param signatureData A dictionary of strings to use for stacking.
119+
* @param title An optional title for the stacking information.
120+
* @returns {EventBuilder}
121+
*/
122+
public setManualStackingInfo(signatureData: any, title?: string) {
123+
if (signatureData) {
124+
let stack = <IManualStackingInfo>{
125+
signature_data: signatureData
126+
};
127+
if (title) {
128+
stack.title = title;
129+
}
130+
this.setProperty('@stack', stack);
131+
}
132+
133+
return this;
134+
}
135+
114136
/**
115137
* Changes default stacking behavior by setting the stacking key.
116138
* @param manualStackingKey The manual stacking key.
139+
* @param title An optional title for the stacking information.
117140
* @returns {EventBuilder}
118141
*/
119-
public setManualStackingKey(manualStackingKey: string): EventBuilder {
142+
public setManualStackingKey(manualStackingKey: string, title?: string): EventBuilder {
120143
if (manualStackingKey) {
121-
this.setProperty('@stack', manualStackingKey);
144+
let data = {
145+
'ManualStackingKey': manualStackingKey
146+
};
147+
this.setManualStackingInfo(data, title);
122148
}
123149

124150
return this;

src/models/IManualStackingInfo.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface IManualStackingInfo {
2+
title?: string;
3+
signature_data?: any;
4+
}

0 commit comments

Comments
 (0)