Always check LOG before console.log (from websocket branch).
diff --git a/js/Key.js b/js/Key.js
index 072194b..f5b56e0 100644
--- a/js/Key.js
+++ b/js/Key.js
@@ -33,7 +33,7 @@
this.keyName = _input;
}
else if(_type==KeyLocatorType.KEY){
- console.log('SET KEY');
+ if(LOG>4)console.log('SET KEY');
this.publicKey = _input;
}
else if(_type==KeyLocatorType.CERTIFICATE){
@@ -105,7 +105,7 @@
KeyLocator.prototype.to_ccnb = function( encoder) {
- if(LOG>2) console.log('type is is ' + this.type);
+ if(LOG>4) console.log('type is is ' + this.type);
//TODO Check if Name is missing
if (!this.validate()) {
throw new ContentEncodingException("Cannot encode " + this.getClass().getName() + ": field values missing.");
diff --git a/js/encoding/DataUtils.js b/js/encoding/DataUtils.js
index 8b2518f..2db59d5 100644
--- a/js/encoding/DataUtils.js
+++ b/js/encoding/DataUtils.js
@@ -228,12 +228,13 @@
*/
//http://ejohn.org/blog/numbers-hex-and-colors/
DataUtils.toHex = function(arguments){
- if(LOG>4) console.log('ABOUT TO CONVERT '+ arguments);
- //console.log(arguments);
- var ret = "";
- for ( var i = 0; i < arguments.length; i++ )
- ret += (arguments[i] < 16 ? "0" : "") + arguments[i].toString(16);
- return ret; //.toUpperCase();
+ if (LOG>4) console.log('ABOUT TO CONVERT '+ arguments);
+ //console.log(arguments);
+ var ret = "";
+ for ( var i = 0; i < arguments.length; i++ )
+ ret += (arguments[i] < 16 ? "0" : "") + arguments[i].toString(16);
+ if (LOG>4) console.log('Converted to: ' + ret);
+ return ret; //.toUpperCase();
}
/**