Dev: Expose log methods of console

This commit is contained in:
surunzi
2016-08-13 11:56:38 +08:00
parent 36a42ea774
commit d2e2beb0e2

View File

@@ -17,6 +17,7 @@ export default class Console extends Tool
this._appendTpl();
this._initLog();
this._exposeLog();
this._initConfig(parent);
this._bindEvent(parent);
}
@@ -103,6 +104,12 @@ export default class Console extends Tool
$this[isMatch ? 'addClass' : 'rmClass']('eruda-active');
}));
}
_exposeLog()
{
let log = this._log;
CONSOLE_METHOD.forEach(name => this[name] = (...args) => log[name](...args));
}
_bindEvent(parent)
{
let $input = this._$input,