type LogLevel = 'debug' | 'info' | 'warning' | 'error'; interface ILogArgs { level: LogLevel; time: number; roomId: string; message: string; device: string; component?: string; } export class LogLine { static LAST_ID = 0 id: number roomId: string level: LogLevel time: Date message: string device: string component?: string constructor(data: ILogArgs) { this.id = ++LogLine.LAST_ID this.roomId = data.roomId this.level = data.level this.message = data.message this.device = data.device this.component = data.component this.time = typeof data.time == "number" ? new Date(data.time*1000) : data.time } }