mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2024-12-02 12:06:53 -05:00
18 lines
436 B
JavaScript
18 lines
436 B
JavaScript
var util = require('util')
|
|
|
|
var debug;
|
|
if(process.env.NODE_DEBUG && /(minecraft-protocol|mc-proto)/.test(process.env.NODE_DEBUG)) {
|
|
var pid = process.pid;
|
|
debug = function(x) {
|
|
// if console is not set up yet, then skip this.
|
|
if(!console.error)
|
|
return;
|
|
console.error('MC-PROTO: %d', pid,
|
|
util.format.apply(util, arguments).slice(0, 500));
|
|
};
|
|
} else {
|
|
debug = function() {
|
|
};
|
|
}
|
|
|
|
module.exports = debug;
|