summary refs log tree commit diff
path: root/v2/logger.ts
blob: 641a40616babd1f4957b504af97068dc8d2f7bb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class Log {
    time: number = Number(new Date());
    data: string = "";
    constructor (data: string, time?: number) {
        this.data = data;
        if(time) this.time = time;
    }
}

class Logger {
    logs: Log[] = [];

    constructor () {

    }

    log (data: string) {
        this.logs.push(new Log(data))
    }

    dump (): string[] {
        return this.logs.map(log => ``)
    }
}