forked from exceptionless/Exceptionless.JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.ts
More file actions
36 lines (35 loc) · 1.17 KB
/
Event.ts
File metadata and controls
36 lines (35 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
export class Event {
/** The event type (ie. error, log message, feature usage). */
type?: string;
/** The event source (ie. machine name, log name, feature name). */
source?: string;
/** The date that the event occurred on. */
date?: Date;
/** A list of tags used to categorize this event. */
tags?: string[];
/** The event message. */
message?: string;
/** The geo coordinates where the event happened. */
geo?: string;
/** The value of the event if any. */
value?: number;
/** The number of duplicated events. */
count?: number;
/** An optional identifier to be used for referencing this event instance at a later time. */
reference_id?: string;
/** Optional data entries that contain additional information about this event. */
data?: Record<string, any>; // TODO: Add typing for known keys.
}
export const enum KnownEventDataKeys {
Error = "@error",
SimpleError = "@simple_error",
RequestInfo = "@request",
TraceLog = "@trace",
EnvironmentInfo = "@environment",
UserInfo = "@user",
UserDescription = "@user_description",
Version = "@version",
Level = "@level",
SubmissionMethod = "@submission_method",
ManualStackingInfo = "@stack"
}