mirror of
https://github.com/amark/gun.git
synced 2025-06-05 13:46:43 +00:00
4 lines, improve logging slightly (#1153)
* use gun.log.once for logging consistency * -
This commit is contained in:
parent
49973ac522
commit
17af355ac1
4
axe.js
4
axe.js
@ -42,8 +42,8 @@
|
||||
tmp = peers[id = 'http://localhost:8765/gun'] = peers[id] || {};
|
||||
tmp.id = tmp.url = id;
|
||||
tmp.retry = tmp.retry || 0; // BUG: Check 0?
|
||||
console.log("AXE enabled: Trying to find network via (1) local peer (2) last used peers (3) hard coded peers.");
|
||||
console.log("Warning: AXE alpha became super slow & laggy, now in testing only mode!");
|
||||
Gun.log.once("AXE enabled: Trying to find network via (1) local peer (2) last used peers (3) hard coded peers.");
|
||||
Gun.log.once("Warning: AXE alpha became super slow & laggy, now in testing only mode!");
|
||||
var last = JSON.parse((localStorage||'')[(opt.file||'')+'axe/']||null) || {};
|
||||
Object.keys(last.peers||'').forEach(function(key){
|
||||
tmp = peers[id = key] = peers[id] || {};
|
||||
|
2
gun.js
2
gun.js
@ -1766,7 +1766,7 @@
|
||||
;(function(){
|
||||
var u;
|
||||
if(''+u == typeof Gun){ return }
|
||||
var DEP = function(n){ console.log("Warning! Deprecated internal utility will break in next version:", n) }
|
||||
var DEP = function(n){ console.warn("Warning! Deprecated internal utility will break in next version:", n) }
|
||||
// Generic javascript utilities.
|
||||
var Type = Gun;
|
||||
//Type.fns = Type.fn = {is: function(fn){ return (!!fn && fn instanceof Function) }}
|
||||
|
@ -10,7 +10,7 @@ function start(root){
|
||||
var opt = root.opt, peers = opt.peers;
|
||||
if(false === opt.axe){ return }
|
||||
if((typeof process !== "undefined") && 'false' === ''+(process.env||'').AXE){ return }
|
||||
console.log("AXE relay enabled!");
|
||||
Gun.log.once("AXE relay enabled!");
|
||||
var axe = root.axe = {}, tmp, id;
|
||||
var mesh = opt.mesh = opt.mesh || Gun.Mesh(root); // DAM!
|
||||
var dup = root.dup;
|
||||
|
@ -36,7 +36,7 @@ Gun.on('create', function(root){
|
||||
socket.send(buf, 0, buf.length, udp.port, udp.address, noop);
|
||||
}
|
||||
|
||||
console.log('Multicast on', udp.peer.id);
|
||||
Gun.log.once('Multicast on', udp.peer.id);
|
||||
return; // below code only needed for when WebSocket connections desired!
|
||||
setInterval(function broadcast(){
|
||||
port = port || (opt.web && opt.web.address()||{}).port;
|
||||
|
Loading…
x
Reference in New Issue
Block a user