mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-07-02 05:56:22 +00:00
Allow switching between stdout and stderr logs in config.ts
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user