log.ts 465 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
import { ErrorMessage } from "./error";

export class cLog {
    private _messages: ErrorMessage[] = [];

    public add(m: ErrorMessage) {
        this._messages.push(m);
    }

    public get messages() {
        return this._messages;
    }
13
14
15
16
17
18
19
20
21
22

    public toString(): string {
        let res = "";
        for (let m of this._messages) {
            if (res != "")
                res += "\n";
            res += m.toString();
        }
        return res;
    }
23
}