diff --git a/bower.json b/bower.json index 2b0395f..61632ae 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "rekord-debug", - "version": "1.4.2", + "version": "1.4.3", "homepage": "https://github.com/Rekord/rekord-debug", "authors": [ "Philip Diffenderfer " diff --git a/build/rekord-debug.js b/build/rekord-debug.js index 82e94b6..15bc5b5 100644 --- a/build/rekord-debug.js +++ b/build/rekord-debug.js @@ -1,11 +1,11 @@ -/* rekord-debug 1.4.2 - A rekord binding to console - implementing Rekord.debug by Philip Diffenderfer */ +/* rekord-debug 1.4.3 - A rekord binding to console - implementing Rekord.debug by Philip Diffenderfer */ // UMD (Universal Module Definition) (function (root, factory) { if (typeof define === 'function' && define.amd) // jshint ignore:line { // AMD. Register as an anonymous module. - define(['Rekord'], function(Rekord) { // jshint ignore:line + define(['rekord'], function(Rekord) { // jshint ignore:line return factory(root, Rekord); }); } @@ -14,7 +14,7 @@ // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. - module.exports = factory(global, require('Rekord')); // jshint ignore:line + module.exports = factory(global, require('rekord')); // jshint ignore:line } else { diff --git a/build/rekord-debug.min.js b/build/rekord-debug.min.js index 3f3db81..991056d 100644 --- a/build/rekord-debug.min.js +++ b/build/rekord-debug.min.js @@ -1,3 +1,3 @@ -/* rekord-debug 1.4.2 - A rekord binding to console - implementing Rekord.debug by Philip Diffenderfer */ -!function(e,o){"function"==typeof define&&define.amd?define(["Rekord"],function(l){return o(e,l)}):"object"==typeof module&&module.exports?module.exports=o(global,require("Rekord")):e.Rekord=o(e,e.Rekord)}(this,function(e,o,l){function d(e){return e instanceof o.Model?"["+e.$db.className+":"+e.$db.summarize(e)+"] ":e instanceof o.Database?"["+e.className+"] ":e instanceof o.Relation?"["+e.database.className+":"+e.type+":"+e.model.Database.className+"] ":e instanceof o.Operation?"["+e.type+"] ":!1}function a(e,o){var l=d(e);if(l!==!1)return l;for(var a=0;a1&&r.groupCollapsed){r.groupCollapsed("%c"+arguments[0],o.debugStyle);for(var n=1;n1&&r.groupCollapsed){r.groupCollapsed("%c"+arguments[0],o.debugStyle);for(var n=1;n 1 && console.groupCollapsed )\n {\n console.groupCollapsed( '%c' + arguments[0], Rekord.debugStyle );\n for (var i = 1; i < arguments.length; i++) {\n console.log( arguments[ i ] );\n }\n console.groupEnd();\n }\n else\n {\n console.log.apply( console, arguments );\n }\n }\n };\n\n return Rekord;\n\n}));\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"sources":["rekord-debug.min.js"],"names":["root","factory","define","amd","Rekord","module","exports","global","require","this","undefined","getContext","x","Model","$db","className","summarize","Database","Relation","database","type","model","Operation","findContext","that","args","c","i","length","console","debugMap",0,1,2,3,4,5,6,7,8,9,10,11,12,73,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,104,105,106,107,108,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,58,59,60,111,112,61,62,63,64,65,66,67,69,70,71,72,113,114,74,75,76,77,78,79,80,81,82,83,84,85,86,87,115,116,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,68,117,118,50,121,109,110,119,120,"debugExclude","debugInclude","debugNoData","debugWithData","debugTrace","debugStyle","debug","eventType","source","indexOf","Array","prototype","slice","call","arguments","context","description","push","Error","groupCollapsed","log","groupEnd","apply"],"mappings":"CAEC,SAAUA,EAAMC,GAEO,kBAAXC,SAAyBA,OAAOC,IAGzCD,QAAQ,UAAW,SAASE,GAC1B,MAAOH,GAAQD,EAAMI,KAGE,gBAAXC,SAAuBA,OAAOC,QAK5CD,OAAOC,QAAUL,EAAQM,OAAQC,QAAQ,WAKzCR,EAAKI,OAASH,EAAQD,EAAMA,EAAKI,SAEnCK,KAAM,SAASF,EAAQH,EAAQM,GA4K/B,QAASC,GAAWC,GAElB,MAAKA,aAAaR,GAAOS,MAEhB,IAAMD,EAAEE,IAAIC,UAAY,IAAMH,EAAEE,IAAIE,UAAWJ,GAAM,K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,EAE7D,MAGF,IAAKA,IAAa5J,GAAO0B,SACzB,CACE,GAAIL,GAAO0I,MAAMC,UAAUC,MAAMC,KAAMC,UAAW,EAE7CnK,GAAOwJ,iBAAkB,EAEvBxJ,EAAO8J,QAAS9J,EAAOwJ,cAAeI,MAAgB,IAEzDvI,MAGMrB,EAAO8J,QAAS9J,EAAOuJ,YAAaK,MAAgB,IAE5DvI,KAGF,IAAI+I,GAAUjJ,EAAa0I,EAAQxI,GAC/BgJ,EAAcrK,EAAO0B,SAAUkI,EAOnC,IALK5J,EAAOyJ,YAEVpI,EAAKiJ,KAAM,GAAIC,QAGZlJ,EAAKG,QAAUC,EAAQ+I,eAC5B,CACE/I,EAAQ+I,eAAgB,KAAOJ,EAAUC,EAAarK,EAAO0J,WAC7D,KAAK,GAAInI,GAAI,EAAGA,EAAIF,EAAKG,OAAQD,IAC/BE,EAAQgJ,IAAKpJ,EAAKE,GAEpBE,GAAQiJ,eAIRjJ,GAAQgJ,IAAK,KAAOL,EAAUC,EAAarK,EAAO0J,gBAKpD,IAAKS,UAAU3I,OAAS,GAAKC,EAAQ+I,eACrC,CACE/I,EAAQ+I,eAAgB,KAAOL,UAAU,GAAInK,EAAO0J,WACpD,KAAK,GAAInI,GAAI,EAAGA,EAAI4I,UAAU3I,OAAQD,IACpCE,EAAQgJ,IAAKN,UAAW5I,GAE1BE,GAAQiJ,eAIRjJ,GAAQgJ,IAAIE,MAAOlJ,EAAS0I,YAK3BnK","file":"rekord-debug.min.js","sourcesContent":["/* rekord-debug 1.4.3 - A rekord binding to console - implementing Rekord.debug by Philip Diffenderfer */\n// UMD (Universal Module Definition)\n(function (root, factory)\n{\n if (typeof define === 'function' && define.amd) // jshint ignore:line\n {\n // AMD. Register as an anonymous module.\n define(['rekord'], function(Rekord) { // jshint ignore:line\n return factory(root, Rekord);\n });\n }\n else if (typeof module === 'object' && module.exports) // jshint ignore:line\n {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory(global, require('rekord')); // jshint ignore:line\n }\n else\n {\n // Browser globals (root is window)\n root.Rekord = factory(root, root.Rekord);\n }\n}(this, function(global, Rekord, undefined)\n{\n\n if ( !global.console )\n {\n return;\n }\n\n var console = global.console;\n\n Rekord.debugMap =\n {\n /* Rekord */\n 0: 'Created',\n /**/\n /* REST */\n 1: 'REST',\n /**/\n /* Remote Data Processed */\n 2: 'Remote data received, existing model updated',\n 3: 'Remote data received, new model created',\n /**/\n /* Loading */\n 4: 'Model remotely removed, removed locally',\n 5: 'Models loaded remotely',\n 6: 'Offline, failed loading models remotely',\n 7: 'Error loading remote models',\n 8: 'Saved model removed locally because it does not exist remotely',\n 9: 'Models loaded locally',\n 10: 'Model deleted locally, resuming remote deletion',\n 11: 'Model loaded but not saved, resuming save',\n 12: 'Model loaded',\n 73: 'Auto-refresh',\n /**/\n /* Real-time */\n 13: 'Real-time save',\n 14: 'Real-time removal',\n /**/\n /* Save */\n 15: 'Model saved values',\n 16: 'Model save published',\n 17: 'Model save failure, conflicted',\n 18: 'Model update failure, does not exist remotely',\n 19: 'Model save error for',\n 20: 'Model save failure, offline!',\n 21: 'Model save resume',\n 22: 'Models loading remotely resumed',\n 23: 'Model saved locally',\n 24: 'Model failed to save locally, will still try to save it remotely',\n 25: 'Model saved remotely',\n /**/\n /* Remove */\n 26: 'Model remove published',\n 27: 'Model removed locally',\n 28: 'Model remove failure, does not exist remotely',\n 29: 'Model remove error',\n 30: 'Model remove failure, offline!',\n 31: 'Model remove resume',\n 32: 'Model removed remotely',\n 33: 'Model removed locally',\n 34: 'Model failed to remove locally, will still try to remove it remotely',\n /**/\n /* Get */\n 104: 'Model local get skipped',\n 105: 'Model local get',\n 106: 'Model local get error',\n 107: 'Model remote get',\n 108: 'Model remote get error',\n /**/\n /* Network Status */\n 35: 'Application Online',\n 36: 'Application Offline',\n /**/\n /* Live */\n 37: 'LIVE',\n /**/\n /* Save */\n 38: 'Model local save ineffective, model is deleted',\n 39: 'Model local save blocked, waiting until previous operation finishes',\n 40: 'Model save ineffective, model is deleted',\n 41: 'Model remote save ineffective, model is deleted',\n 42: 'Model remove save blocked, waiting until previous operation finishes',\n /**/\n /* Remove */\n 43: 'Model remote remove blocked, waiting until previous operation finishes',\n 44: 'Model local remove blocked, waiting until previous operation finishes',\n 45: 'Model local remove ineffective, no local model to remove',\n 46: 'Model local remove effective, unsaved model removed',\n /**/\n /* Save Block */\n 47: 'Model had a pending save that was canceled by remove',\n 48: 'Model update blocked with older revision',\n /**/\n /* Has One Relationship */\n 49: 'Model ninja removed',\n 51: 'Initial pulled from model',\n 52: 'Initial value loaded',\n 53: 'Initialized',\n 54: 'Relation cleared',\n 55: 'Relation set',\n 56: 'Pre-save',\n 57: 'Post-remove',\n 58: 'Clear key',\n 59: 'Set key',\n 60: 'Loaded',\n 111:'Query',\n 112:'Query results',\n /**/\n /* Belongs To Relationship */\n 61: 'Initialized',\n 62: 'Model ninja removed',\n 63: 'Model ninja saved',\n 64: 'Initial pulled from model',\n 65: 'Initial value loaded',\n 66: 'Relation cleared',\n 67: 'Relation set',\n 69: 'Post-remove',\n 70: 'Clear key',\n 71: 'Set key',\n 72: 'Loaded',\n 113:'Query',\n 114:'Query results',\n /**/\n /* Has Many Relationship */\n 74: 'Initialized',\n 75: 'Model ninja removed',\n 76: 'Model ninja saved',\n 77: 'Initial value loaded',\n 78: 'Initial pulled from model',\n 79: 'Model removed',\n 80: 'Models sorted',\n 81: 'Model added',\n 82: 'Models lazily loaded',\n 83: 'Model grabbed based on initial',\n 84: 'Model ninja added',\n 85: 'Auto-saving',\n 86: 'Pre-remove',\n 87: 'Post-save',\n 115:'Query',\n 116:'Query results',\n /**/\n /* Has Many Through Relationship */\n 88: 'Initialized',\n 89: 'Model ninja removed',\n 90: 'Model ninja saved',\n 91: 'Through ninja removed',\n 92: 'Initial value loaded',\n 93: 'Initial pulled from model',\n 94: 'Model removed',\n 95: 'Models sorted',\n 96: 'Model added',\n 97: 'Models lazily loaded',\n 98: 'Model grabbed based on initial',\n 99: 'Model ninja added',\n 100:'Auto-saving',\n 101:'Pre-remove',\n 102:'Post-save',\n 103:'Through added',\n 68: 'Through removed',\n 117:'Query',\n 118:'Query results',\n /**/\n /* Has Remote Relationship */\n 50: 'Initialized',\n 121:'Models sorted',\n 109:'Model ninja removed',\n 110:'Model ninja saved',\n 119:'Query',\n 120:'Query results'\n /**/\n };\n\n function getContext(x)\n {\n if ( x instanceof Rekord.Model )\n {\n return '[' + x.$db.className + ':' + x.$db.summarize( x ) + '] ';\n }\n if ( x instanceof Rekord.Database )\n {\n return '[' + x.className + '] ';\n }\n if ( x instanceof Rekord.Relation )\n {\n return '[' + x.database.className + ':' + x.type + ':' + x.model.Database.className + '] ';\n }\n if ( x instanceof Rekord.Operation )\n {\n return '[' + x.type + '] ';\n }\n\n return false;\n }\n\n function findContext(that, args)\n {\n var c = getContext( that );\n\n if (c !== false)\n {\n return c;\n }\n\n for (var i = 0; i < args.length; i++)\n {\n var c = getContext( args[i] );\n\n if ( c !== false )\n {\n return c;\n }\n }\n\n return '[Rekord] ';\n }\n\n Rekord.debugExclude = [];\n\n Rekord.debugInclude = false;\n\n Rekord.debugNoData = [];\n\n Rekord.debugWithData = false;\n\n Rekord.debugTrace = false;\n\n Rekord.debugStyle = 'color:blue; font-weight:bold';\n\n Rekord.debug = function(eventType, source)\n {\n if ( Rekord.debugInclude !== false )\n {\n if ( Rekord.indexOf( Rekord.debugInclude, eventType ) === false )\n {\n return;\n }\n }\n else if ( Rekord.indexOf( Rekord.debugExclude, eventType ) !== false )\n {\n return;\n }\n\n if ( eventType in Rekord.debugMap )\n {\n var args = Array.prototype.slice.call( arguments, 1 );\n\n if ( Rekord.debugWithData !== false )\n {\n if ( Rekord.indexOf( Rekord.debugWithData, eventType ) === false )\n {\n args = [];\n }\n }\n else if ( Rekord.indexOf( Rekord.debugNoData, eventType ) !== false )\n {\n args = [];\n }\n\n var context = findContext( source, args );\n var description = Rekord.debugMap[ eventType ];\n\n if ( Rekord.debugTrace )\n {\n args.push( new Error() );\n }\n\n if ( args.length && console.groupCollapsed )\n {\n console.groupCollapsed( '%c' + context + description, Rekord.debugStyle );\n for (var i = 0; i < args.length; i++) {\n console.log( args[i] );\n }\n console.groupEnd();\n }\n else\n {\n console.log( '%c' + context + description, Rekord.debugStyle );\n }\n }\n else\n {\n if ( arguments.length > 1 && console.groupCollapsed )\n {\n console.groupCollapsed( '%c' + arguments[0], Rekord.debugStyle );\n for (var i = 1; i < arguments.length; i++) {\n console.log( arguments[ i ] );\n }\n console.groupEnd();\n }\n else\n {\n console.log.apply( console, arguments );\n }\n }\n };\n\n return Rekord;\n\n}));\n"],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/package.json b/package.json index 2036c10..0289247 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rekord-debug", - "version": "1.4.2", + "version": "1.4.3", "description": "A rekord binding to console - implementing Rekord.debug", "author": "Philip Diffenderfer", "license": "MIT", diff --git a/src/debug.js b/src/debug.js index c815fd4..9c3c551 100644 --- a/src/debug.js +++ b/src/debug.js @@ -4,7 +4,7 @@ if (typeof define === 'function' && define.amd) // jshint ignore:line { // AMD. Register as an anonymous module. - define(['Rekord'], function(Rekord) { // jshint ignore:line + define(['rekord'], function(Rekord) { // jshint ignore:line return factory(root, Rekord); }); } @@ -13,7 +13,7 @@ // Node. Does not work with strict CommonJS, but // only CommonJS-like environments that support module.exports, // like Node. - module.exports = factory(global, require('Rekord')); // jshint ignore:line + module.exports = factory(global, require('rekord')); // jshint ignore:line } else {