mirror of
https://github.com/nuintun/command-manager.git
synced 2025-12-20 10:35:53 +08:00
update files
This commit is contained in:
33
bin/terminal/lib/debug.js
Normal file
33
bin/terminal/lib/debug.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Created by nuintun on 2015/11/24.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function (Terminal){
|
||||
/**
|
||||
* log
|
||||
*/
|
||||
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);
|
||||
};
|
||||
|
||||
/**
|
||||
* error
|
||||
*/
|
||||
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);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user