##// END OF EJS Templates
Fixed substitution spec handling in log/ConsoleWriter
Fixed substitution spec handling in log/ConsoleWriter

File last commit:

r82:025f02eff3b2 v1.3.0 default
r85:ad9a66d0ebe4 v1.3.1 default
Show More
MockConsole.ts
52 lines | 1.0 KiB | video/mp2t | TypeScriptLexer
import {NullConsole} from "@implab/core/log/NullConsole";
interface ConsoleLineData {
level: string;
data: any[];
}
export class MockConsole extends NullConsole {
_buffer: ConsoleLineData[] = [];
debug(...args: any[]) {
this._buffer.push({
level: "debug",
data: args
});
}
log(...args: any[]) {
this._buffer.push({
level: "log",
data: args
});
}
warn(...args: any[]) {
this._buffer.push({
level: "warn",
data: args
});
}
error(...args: any[]) {
this._buffer.push({
level: "error",
data: args
});
}
getBuffer() {
return this._buffer;
}
getLine(i: number) {
if (i >= this._buffer.length)
throw new Error(`Line number ${i} is out of range, buffer.length = ${this._buffer.length}`);
return this._buffer[i].data;
}
clear() {
this._buffer = [];
}
}