Allow switching between stdout and stderr logs in config.ts

This commit is contained in:
Kristóf Tóth
2018-05-28 16:36:19 +02:00
parent 0aa67b25aa
commit 1b8a36331c
5 changed files with 17 additions and 9 deletions

View File

@ -13,6 +13,7 @@ import { config } from '../config';
})
export class ConsoleComponent implements OnInit {
console_content: string = config.console.defaultContent;
rewriteContentWithNewLogs: string = config.console.rewriteContentWithNewLogs;
command_handlers = {
'write': this.writeHandler.bind(this),
@ -36,9 +37,12 @@ export class ConsoleComponent implements OnInit {
this.sendContent(this.console_content);
}
newLogHandler(content: string) {
if (config.console.rewriteContentWithNewLogs) {
this.setContent(content);
newLogHandler(logs: any) {
if (this.rewriteContentWithNewLogs !== '') {
const log = logs[this.rewriteContentWithNewLogs];
if (log) {
this.setContent(log);
}
}
}