Skip to content

Commit 65136a6

Browse files
author
Robert Jackson
committed
Add parent's name to logging output.
1 parent 33c3f74 commit 65136a6

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

lib/ember-addon-main.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
const path = require('path');
44
const utils = require('./utils');
5-
const logger = require('heimdalljs-logger')('ember-cli-htmlbars:addon');
65
const hasEdition = require('@ember/edition-utils').has;
76

87
let registryInvocationCounter = 0;
@@ -12,6 +11,14 @@ module.exports = {
1211

1312
parentRegistry: null,
1413

14+
init() {
15+
this._super.init.apply(this, arguments);
16+
17+
let parentName = typeof this.parent.name === 'function' ? this.parent.name() : this.parent.name;
18+
19+
this.logger = require('heimdalljs-logger')('ember-cli-htmlbars:addon:' + parentName);
20+
},
21+
1522
_shouldColocateTemplates() {
1623
if (this._cachedShouldColocateTemplates) {
1724
return this._cachedShouldColocateTemplates;
@@ -36,9 +43,8 @@ module.exports = {
3643
this._cachedShouldColocateTemplates =
3744
hasOctane && hasValidBabelVersion && hasValidEmberCLIVersion;
3845

39-
logger.info(
40-
`Colocation processing: ${this._cachedShouldColocateTemplates} (hasOctane: ${hasOctane}; hasValidEmberCLIVersion: ${hasValidEmberCLIVersion}; hasVali
41-
dBabelVersion: ${hasValidBabelVersion};`
46+
this.logger.info(
47+
`Colocation processing: ${this._cachedShouldColocateTemplates} (hasOctane: ${hasOctane}; hasValidEmberCLIVersion: ${hasValidEmberCLIVersion}; hasValidBabelVersion: ${hasValidBabelVersion};`
4248
);
4349

4450
return this._cachedShouldColocateTemplates;
@@ -140,7 +146,7 @@ dBabelVersion: ${hasValidBabelVersion};`
140146
let templateCompilerPath = this.templateCompilerPath();
141147

142148
if (pluginInfo.canParallelize) {
143-
logger.debug('using parallel API with for babel inline precompilation plugin');
149+
this.logger.debug('using parallel API with for babel inline precompilation plugin');
144150

145151
let htmlbarsInlinePrecompilePlugin = utils.buildParalleizedBabelPlugin(
146152
pluginInfo,
@@ -149,8 +155,8 @@ dBabelVersion: ${hasValidBabelVersion};`
149155

150156
babelPlugins.push(htmlbarsInlinePrecompilePlugin);
151157
} else {
152-
logger.debug('NOT using parallel API with for babel inline precompilation plugin');
153-
logger.debug('Prevented by these plugins: ' + pluginInfo.unparallelizableWrappers);
158+
this.logger.debug('NOT using parallel API with for babel inline precompilation plugin');
159+
this.logger.debug('Prevented by these plugins: ' + pluginInfo.unparallelizableWrappers);
154160

155161
let htmlBarsPlugin = utils.setup(pluginInfo, {
156162
projectConfig: this.projectConfig(),

0 commit comments

Comments
 (0)