Skip to content

Instantly share code, notes, and snippets.

@oleersoy
Created October 12, 2019 16:30
Show Gist options
  • Save oleersoy/6c744c3abc49339ef3fb9441fdca54ff to your computer and use it in GitHub Desktop.
Save oleersoy/6c744c3abc49339ef3fb9441fdca54ff to your computer and use it in GitHub Desktop.
console
export class Console {
textarea: HTMLTextAreaElement;
constructor(container: HTMLElement) {
this.textarea = document.createElement("textarea");
container.appendChild(this.textarea);
}
/**
* @param
*/
log(message: string, type?: string) {
if (type) this.textarea.value += type + ": ";
this.textarea.value += message + "\n";
}
error = function(txt: string) {
this.log(txt, "ERROR!");
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment