This repository has been archived on 2022-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
irreligious/src/model/logging/DebugLogger.ts

18 lines
477 B
TypeScript

class DebugLogger implements ILogger {
private readonly _container: HTMLElement;
constructor (container: HTMLElement) {
this._container = container;
}
public msg (text: string): void {
const p: HTMLElement = document.createElement('p');
p.innerText = text;
this._container.appendChild(p);
if (this._container.parentElement !== null) {
this._container.parentElement.scrollTop =
this._container.parentElement.scrollHeight;
}
}
}