Format files

This commit is contained in:
Andras Schmelczer 2025-01-05 15:35:51 +00:00
commit 438caa96a6
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 557 additions and 585 deletions

View file

@ -4,19 +4,22 @@ export enum LogLevel {
DEBUG = "DEBUG",
INFO = "INFO",
WARNING = "WARNING",
ERROR = "ERROR",
ERROR = "ERROR"
}
const LOG_LEVEL_ORDER = {
[LogLevel.DEBUG]: 0,
[LogLevel.INFO]: 1,
[LogLevel.WARNING]: 2,
[LogLevel.ERROR]: 3,
[LogLevel.ERROR]: 3
};
class LogLine {
public timestamp = new Date();
public constructor(public level: LogLevel, public message: string) {}
public constructor(
public level: LogLevel,
public message: string
) {}
}
export class Logger {

View file

@ -12,18 +12,18 @@ export interface CommonHistoryEntry {
export enum SyncType {
CREATE = "CREATE",
UPDATE = "UPDATE",
DELETE = "DELETE",
DELETE = "DELETE"
}
export enum SyncSource {
PUSH = "PUSH",
PULL = "PULL",
PULL = "PULL"
}
export enum SyncStatus {
NO_OP = "NO_OP",
SUCCESS = "SUCCESS",
ERROR = "ERROR",
ERROR = "ERROR"
}
export type HistoryEntry = CommonHistoryEntry & { timestamp: Date };
@ -44,7 +44,7 @@ export class SyncHistory {
private status: HistoryStats = {
success: 0,
error: 0,
error: 0
};
public getEntries(): HistoryEntry[] {
@ -55,7 +55,7 @@ export class SyncHistory {
this.entries.length = 0;
this.status = {
success: 0,
error: 0,
error: 0
};
this.syncHistoryUpdateListeners.forEach((listener) => {
listener(this.status);
@ -72,7 +72,7 @@ export class SyncHistory {
public addHistoryEntry(entry: CommonHistoryEntry): void {
const historyEntry = {
...entry,
timestamp: new Date(),
timestamp: new Date()
};
this.entries.push(historyEntry);