mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-09 04:34:04 +08:00
28 lines
587 B
JavaScript
28 lines
587 B
JavaScript
/**
|
|
* Created by nuintun on 2015/11/24.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
module.exports = function (Terminal){
|
|
Terminal.prototype.log = function (){
|
|
if (!this.debug) return;
|
|
|
|
if (!window.console || !window.console.log) return;
|
|
|
|
var args = Array.prototype.slice.call(arguments);
|
|
|
|
window.console.log.apply(window.console, args);
|
|
};
|
|
|
|
Terminal.prototype.error = function (){
|
|
if (!this.debug) return;
|
|
|
|
if (!window.console || !window.console.error) return;
|
|
|
|
var args = Array.prototype.slice.call(arguments);
|
|
|
|
window.console.error.apply(window.console, args);
|
|
};
|
|
};
|