diff --git a/packages/ember-application/tests/system/logging_test.js b/packages/ember-application/tests/system/logging_test.js index 8e6d4f473e6..9b3c9566e14 100644 --- a/packages/ember-application/tests/system/logging_test.js +++ b/packages/ember-application/tests/system/logging_test.js @@ -205,7 +205,7 @@ QUnit.test("do not log when template and view are missing when flag is not true" }); }); -QUnit.skip("log which view is used with a template", function() { +QUnit.test("log which view is used with a template", function() { if (EmberDev && EmberDev.runningProdBuild) { ok(true, 'Logging does not occur in production builds'); return; @@ -217,7 +217,7 @@ QUnit.skip("log which view is used with a template", function() { run(App, 'advanceReadiness'); visit('/posts').then(function() { - equal(logs['view:application'], 1, 'expected: Should log use of default view'); + equal(logs['view:application'], undefined, 'expected: Should not use a view when only a template is defined'); equal(logs['view:index'], undefined, 'expected: Should not log when index is not present.'); equal(logs['view:posts'], 1, 'expected: Rendering posts with PostsView.'); }); diff --git a/packages/ember-htmlbars/lib/keywords/outlet.js b/packages/ember-htmlbars/lib/keywords/outlet.js index 1c7e1b25ef6..6768f2bb948 100644 --- a/packages/ember-htmlbars/lib/keywords/outlet.js +++ b/packages/ember-htmlbars/lib/keywords/outlet.js @@ -4,6 +4,7 @@ */ import merge from "ember-metal/merge"; +import { get } from "ember-metal/property_get"; import ComponentNode from "ember-htmlbars/system/component-node"; import topLevelViewTemplate from "ember-htmlbars/templates/top-level-view"; @@ -54,6 +55,8 @@ export default { var parentView = env.view; var outletState = state.outletState; var toRender = outletState.render; + var namespace = env.container.lookup('application:main'); + var LOG_VIEW_LOOKUPS = get(namespace, 'LOG_VIEW_LOOKUPS'); var ViewClass = outletState.render.ViewClass; @@ -64,6 +67,10 @@ export default { isOutlet: true }; + if (LOG_VIEW_LOOKUPS && ViewClass) { + Ember.Logger.info("Rendering " + toRender.name + " with " + ViewClass, { fullName: 'view:' + toRender.name }); + } + var componentNode = ComponentNode.create(renderNode, env, {}, options, parentView, null, null, template); state.componentNode = componentNode;