Skip to content

Commit

Permalink
Send log when open cvat
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev committed Feb 17, 2023
1 parent d2bab9c commit f243abe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cvat-core/src/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export enum Source {
}

export enum LogType {
loadTool = 'load:cvat',

loadJob = 'load:job',
saveJob = 'save:job',
restoreJob = 'restore:job',
Expand Down
7 changes: 6 additions & 1 deletion cvat-ui/src/utils/controls-logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class EventRecorder {
#savingInterval: number | null;
public constructor() {
this.#savingInterval = null;
core.logger.log(LogType.loadTool, { location: window.location.pathname + window.location.search });
}

public log(event: MouseEvent): void {
Expand Down Expand Up @@ -52,7 +53,11 @@ class EventRecorder {
}

private filterClassName(cls: string): string {
return cls.split(' ').filter((_cls: string) => _cls.startsWith('cvat')).join(' ');
if (typeof cls === 'string') {
return cls.split(' ').filter((_cls: string) => _cls.startsWith('cvat')).join(' ');
}

return '';
}

private isEventToBeRecorded(node: HTMLElement, filter: string[]): boolean {
Expand Down

0 comments on commit f243abe

Please sign in to comment.