Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Severity Levels for Activity Tracking #3909

Merged
merged 5 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions admin/columns/Tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ export const browser: ColumnSpec = {
width: 100
};

export const severity: ColumnSpec = {
field: {
name: 'severity',
type: 'string',
isDimension: true,
aggregator: 'UNIQUE'
},
width: 80
};

export const category: ColumnSpec = {
field: {
name: 'category',
Expand Down
2 changes: 2 additions & 0 deletions admin/tabs/activity/tracking/ActivityTrackingModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class ActivityTrackingModel extends HoistModel {
fields: [
Col.browser.field,
Col.category.field,
Col.severity.field,
Col.correlationId.field,
Col.data.field,
{...(Col.dateCreated.field as FieldSpec), displayName: 'Timestamp'},
Expand Down Expand Up @@ -131,6 +132,7 @@ export class ActivityTrackingModel extends HoistModel {
{field: 'userAgent'},
{field: 'url', displayName: 'URL'},
{field: 'instance'},
{field: 'severity'},
{field: 'appVersion'},
{field: 'appEnvironment', displayName: 'Environment'}
]
Expand Down
1 change: 1 addition & 0 deletions admin/tabs/activity/tracking/detail/ActivityDetailModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class ActivityDetailModel extends HoistModel {
{...Col.url},
{...Col.correlationId},
{...Col.instance, hidden},
{...Col.severity, hidden},
{...Col.elapsed},
{...Col.dateCreatedWithSec, displayName: 'Timestamp'}
]
Expand Down
16 changes: 13 additions & 3 deletions core/types/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ export interface AppOptionSpec {
omit?: Thunkable<boolean>;
}

/**
* Severity levels for tracking. Default is 'INFO'.
*/
export type TrackSeverity = 'DEBUG' | 'INFO' | 'WARN';

/**
* Options for tracking activity on the server via TrackService.
*/
Expand All @@ -219,11 +224,16 @@ export interface TrackOptions {
logData?: boolean | string[];

/**
* Flag to indicate relative importance of activity.
* Default 'INFO'. Note, errors should be tracked via {@link XH.handleException}, which
* Flag to indicate relative importance of activity. Default 'INFO'.
*
* Allows conditional saving of messages depending on the currently active
* level configuration for the category/user. See HoistCore's 'TrackService' for
* more information.
*
* Note, errors should be tracked via {@link XH.handleException}, which
* will post to the server for dedicated logging if requested.
*/
severity?: string;
severity?: TrackSeverity;

/**
* Set to true to log this message only once during the current session. The category and
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"@ag-grid-community/react": "31.x",
"@types/react": "18.x",
"@types/react-dom": "18.x",
"@xh/hoist-dev-utils": "9.x",
"@xh/hoist-dev-utils": "10.x",
"csstype": "3.x",
"eslint": "8.x",
"eslint-config-prettier": "9.x",
Expand Down
Loading
Loading