vendor/ui/js/src/logger.js in dolt-0.17.0 vs vendor/ui/js/src/logger.js in dolt-0.18.0

- old
+ new

@@ -1,6 +1,6 @@ -/*global gts, cull, dome*/ +/*global cull, dome, console, gts*/ function uinitLogger(app, level) { if (typeof level === "string") { level = uinitLogger.levels.indexOf((level || "info").toLowerCase()); } @@ -18,34 +18,47 @@ if (level <= uinitLogger.DEBUG) { app.on("loading", function (feature) { console.log("[Loading:", feature.name + "]"); }); + + app.on("reloading", function (feature) { + console.log("[Re-loading:", feature.name + "]"); + }); } if (level <= uinitLogger.INFO) { app.on("pending", function (feature) { - var reason, waitingFor = cull.map(cull.prop("name"), cull.select(function (f) { + var name = cull.prop("name"); + var reason, pending = cull.map(name, cull.select(function (f) { return !f.loaded; }, feature.dependencies())); - if (waitingFor.length > 0) { + if (pending.length > 0) { reason = "Waiting for "; - reason += waitingFor.length === 1 ? "dependency" : "dependencies"; - reason += " [" + waitingFor.join(", ") + "]"; + reason += pending.length === 1 ? "dependency" : "dependencies"; + reason += " [" + pending.join(", ") + "]"; } if (!reason && feature.elements) { if (dome.byClass(feature.elements).length === 0) { - reason = "No matching elements for selector ." + feature.elements; + reason = "No matching elements for selector ." + + feature.elements; } } if (!reason && !feature.nullable) { reason = "Feature produced null/undefined but is not nullable"; } console.log("[Pending:", feature.name + "]", reason); + }); + } + + if (level <= uinitLogger.INFO) { + app.on("skip", function (feature) { + console.log("[Skip:", feature.name + "]", + "Reload triggered, but input was unchanged"); }); } if (level <= uinitLogger.INFO) { app.on("loaded", function (feature, result) {