From ba6e99f301ff78aba7b7a84ce41f6c504317b208 Mon Sep 17 00:00:00 2001 From: Jesse Gibson Date: Tue, 3 Nov 2015 15:00:02 -0700 Subject: [PATCH] Take string arguments into `.val()`, prepending your arguments to the console output. Good for debugging. Closes #118 --- gun.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gun.js b/gun.js index 1768100f..abfa5de3 100644 --- a/gun.js +++ b/gun.js @@ -514,8 +514,8 @@ gun.__.on(Gun.is.soul.on(data) + '.end').emit(data); }); return function(cb, opt){ - var gun = this, ctx = {}; - cb = cb || function(val, field){ root.console.log(field + ':', val) } + var gun = this, ctx = {}, args = Array.prototype.slice.call(arguments); + cb = Gun.fns.is(cb)? cb : function(val, field){ root.console.log.apply(root.console, args.concat([field && (field += ':'), val])) } opt = opt || {}; gun.on(function($, delta, on){