Skip to content

Commit b7e39b1

Browse files
clydinfilipesilva
authored andcommitted
refactor(@angular/cli): remove unused ember-cli internal logging
1 parent c7dea78 commit b7e39b1

File tree

8 files changed

+0
-84
lines changed

8 files changed

+0
-84
lines changed

package-lock.json

Lines changed: 0 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@
6060
"file-loader": "^0.10.0",
6161
"fs-extra": "^4.0.0",
6262
"glob": "^7.0.3",
63-
"heimdalljs": "^0.2.4",
64-
"heimdalljs-logger": "^0.1.9",
6563
"html-webpack-plugin": "^2.29.0",
6664
"istanbul-instrumenter-loader": "^2.0.0",
6765
"karma-source-map-support": "^1.2.0",

packages/@angular/cli/ember-cli/lib/cli/cli.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
const lookupCommand = require('./lookup-command');
44
const getOptionArgs = require('../utilities/get-option-args');
5-
let logger = require('heimdalljs-logger')('ember-cli:cli');
6-
let loggerTesting = require('heimdalljs-logger')('ember-cli:testing');
7-
const heimdall = require('heimdalljs');
85

96
// Disabled until e2e and serve command can be evaluated/corrected -- require('../utilities/will-interrupt-process');
107
const onProcessInterrupt = { addHandler: (_handler) => { }, removeHandler: (_handler) => { } };
@@ -70,8 +67,6 @@ class CLI {
7067
stopAndReport: (...args) => { },
7168
start: (...args) => { },
7269
};
73-
74-
logger.info('testing %o', !!this.testing);
7570
}
7671

7772
/**
@@ -103,8 +98,6 @@ class CLI {
10398
let commandArgs = args;
10499
let helpOptions;
105100

106-
let commandLookupCreationtoken = heimdall.start('lookup-command');
107-
108101
let CurrentCommand = lookupCommand(environment.commands, commandName, commandArgs, {
109102
project: environment.project,
110103
ui: this.ui,
@@ -121,14 +114,10 @@ class CLI {
121114
cli: this,
122115
});
123116

124-
commandLookupCreationtoken.stop();
125-
126117
getOptionArgs('--verbose', commandArgs).forEach(arg => {
127118
process.env[`EMBER_VERBOSE_${arg.toUpperCase()}`] = 'true';
128119
});
129120

130-
logger.info('command: %s', commandName);
131-
132121
if (!this.testing) {
133122
let skipInstallationCheck = commandArgs.indexOf('--skip-installation-check') !== -1;
134123
if (environment.project.isEmberCLIProject() && !skipInstallationCheck) {
@@ -144,13 +133,10 @@ class CLI {
144133
instrumentation.stopAndReport('init');
145134
instrumentation.start('command');
146135

147-
loggerTesting.info('cli: command.beforeRun');
148136
onProcessInterrupt.addHandler(onCommandInterrupt);
149137

150138
return command.beforeRun(commandArgs);
151139
}).then(() => {
152-
loggerTesting.info('cli: command.validateAndRun');
153-
154140
return command.validateAndRun(commandArgs);
155141
}).then(result => {
156142
instrumentation.stopAndReport('command', commandName, commandArgs);
@@ -172,7 +158,6 @@ class CLI {
172158

173159
return result;
174160
}).then(exitCode => {
175-
loggerTesting.info(`cli: command run complete. exitCode: ${exitCode}`);
176161
// TODO: fix this
177162
// Possibly this issue: https://github.com/joyent/node/issues/8329
178163
// Wait to resolve promise when running on windows.

packages/@angular/cli/ember-cli/lib/cli/index.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
'use strict';
22

33
// Main entry point
4-
let logger = require('heimdalljs-logger')('ember-cli:cli/index');
54
const path = require('path');
6-
const heimdall = require('heimdalljs');
75

86
// ember-cli and user apps have many dependencies, many of which require
97
// process.addListener('exit', ....) for cleanup, by default this limit for
@@ -14,22 +12,12 @@ const heimdall = require('heimdalljs');
1412
// https://github.com/babel/ember-cli-babel/issues/76
1513
process.setMaxListeners(1000);
1614

17-
function configureLogger(env) {
18-
let depth = Number(env['DEBUG_DEPTH']);
19-
if (depth) {
20-
let logConfig = require('heimdalljs').configFor('logging');
21-
logConfig.depth = depth;
22-
}
23-
}
24-
2515
// Options: Array cliArgs, Stream inputStream, Stream outputStream
2616
module.exports = function(options) {
2717
let UI = options.UI || require('../ui');
2818
const CLI = require('./cli');
2919
const Project = require('../models/project');
3020

31-
configureLogger(process.env);
32-
3321
// TODO: one UI (lib/models/project.js also has one for now...)
3422
let ui = new UI({
3523
inputStream: options.inputStream,

packages/@angular/cli/ember-cli/lib/models/command.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const printCommand = require('../utilities/print-command');
88
const _ = require('lodash');
99
const EOL = require('os').EOL;
1010
const CoreObject = require('core-object');
11-
let logger = require('heimdalljs-logger')('ember-cli:command');
1211
const SilentError = require('silent-error');
1312
const fs = require('fs');
1413

@@ -85,8 +84,6 @@ let Command = CoreObject.extend({
8584
*/
8685
this.name = this.name || '<undefined>';
8786

88-
logger.info('initialize: name: %s, name: %s', this.name);
89-
9087
/**
9188
* An array of aliases for the command
9289
*
@@ -210,8 +207,6 @@ let Command = CoreObject.extend({
210207
throw new Error(`Concurrent tasks are not supported`);
211208
}
212209

213-
logger.info(`\`${this.name}\` command running \`${name}\` task`);
214-
215210
let Task = this.tasks[name];
216211
if (!Task) {
217212
throw new Error(`Unknown task "${name}"`);
@@ -222,11 +217,6 @@ let Command = CoreObject.extend({
222217
this._currentTask = task;
223218

224219
return Promise.resolve().then(() => task.run(options))
225-
.catch(error => {
226-
logger.info(`An error occurred running \`${name}\` from the \`${this.name}\` command.`, error.stack);
227-
228-
throw error;
229-
})
230220
.finally(() => {
231221
delete this._currentTask;
232222
});
@@ -251,7 +241,6 @@ let Command = CoreObject.extend({
251241
let commandOptions = this.parseArgs(args);
252242
// if the help option was passed, resolve with 'callHelp' to call help command
253243
if (commandOptions && (commandOptions.options.help || commandOptions.options.h)) {
254-
logger.info(`${this.name} called with help option`);
255244
return resolve('callHelp');
256245
}
257246

@@ -429,8 +418,6 @@ let Command = CoreObject.extend({
429418
try {
430419
aliasValue = JSON.parse(alias);
431420
} catch (e) {
432-
let logger = require('heimdalljs-logger')('@angular/cli/ember-cli/models/command');
433-
logger.error(e);
434421
}
435422
}
436423
throw new Error(`The "${aliasValue}" [type:${aliasType}] alias is not an acceptable value. ` +

packages/@angular/cli/ember-cli/lib/models/installation-checker.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
'use strict';
22

3-
let logger = require('heimdalljs-logger')('ember-cli:installation-checker');
43
const fs = require('fs-extra');
54
const path = require('path');
65
const SilentError = require('silent-error');
@@ -24,11 +23,9 @@ class InstallationChecker {
2423
let commands = [];
2524

2625
if (this.usingNpm() && this.npmDependenciesNotPresent()) {
27-
logger.info('npm dependencies not installed');
2826
commands.push('`npm install`');
2927
}
3028
if (this.usingBower() && this.bowerDependenciesNotPresent()) {
31-
logger.info('bower dependencies not installed');
3229
commands.push('`bower install`');
3330
}
3431
if (commands.length) {

packages/@angular/cli/ember-cli/lib/models/project.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const findUp = require('../../../utilities/find-up').findUp;
99
let resolve = denodeify(require('resolve'));
1010
const fs = require('fs-extra');
1111
const _ = require('lodash');
12-
let logger = require('heimdalljs-logger')('ember-cli:project');
1312
const nodeModulesPath = require('node-modules-path');
1413

1514
let processCwd = process.cwd();
@@ -29,8 +28,6 @@ class Project {
2928
@param {CLI} cli
3029
*/
3130
constructor(root, pkg, ui, cli) {
32-
logger.info('init root: %s', root);
33-
3431
this.root = root;
3532
this.pkg = pkg;
3633
this.ui = ui;
@@ -75,8 +72,6 @@ class Project {
7572
*/
7673
setupNodeModulesPath() {
7774
this.nodeModulesPath = nodeModulesPath(this.root);
78-
79-
logger.info('nodeModulesPath: %s', this.nodeModulesPath);
8075
}
8176

8277
static nullProject(ui, cli) {
@@ -244,7 +239,6 @@ class Project {
244239
ui.writeDeprecateLine('`Project.closest` is a private method that will be removed, please use `Project.closestSync` instead.');
245240

246241
return closestPackageJSON(pathName).then(result => {
247-
logger.info('closest %s -> %s', pathName, result);
248242
if (result.pkg && result.pkg.name === 'ember-cli') {
249243
return Project.nullProject(_ui, _cli);
250244
}
@@ -264,24 +258,18 @@ class Project {
264258
@return {Project} Project instance
265259
*/
266260
static closestSync(pathName, _ui, _cli) {
267-
logger.info('looking for package.json starting at %s', pathName);
268-
269261
let ui = ensureUI(_ui);
270262

271263
let directory = findupPath(pathName);
272-
logger.info('found package.json at %s', directory);
273264

274265
let relative = path.relative(directory, pathName);
275266
if (relative.indexOf('tmp') === 0) {
276-
logger.info('ignoring parent project since we are in the tmp folder of the project');
277267
return Project.nullProject(_ui, _cli);
278268
}
279269

280270
let pkg = fs.readJsonSync(path.join(directory, 'package.json'));
281-
logger.info('project name: %s', pkg && pkg.name);
282271

283272
if (!isEmberCliProject(pkg)) {
284-
logger.info('ignoring parent project since it is not an Angular CLI project');
285273
return Project.nullProject(_ui, _cli);
286274
}
287275

@@ -319,19 +307,16 @@ class Project {
319307
static getProjectRoot() {
320308
let packagePath = findUp(process.cwd(), 'package.json');
321309
if (!packagePath) {
322-
logger.info('getProjectRoot: not found. Will use cwd: %s', process.cwd());
323310
return process.cwd();
324311
}
325312

326313
let directory = path.dirname(packagePath);
327314
const pkg = require(packagePath);
328315

329316
if (pkg && pkg.name === 'ember-cli') {
330-
logger.info('getProjectRoot: named \'ember-cli\'. Will use cwd: %s', process.cwd());
331317
return process.cwd();
332318
}
333319

334-
logger.info('getProjectRoot %s -> %s', process.cwd(), directory);
335320
return directory;
336321
}
337322
}

packages/@angular/cli/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
"file-loader": "^0.10.0",
4848
"fs-extra": "^4.0.0",
4949
"glob": "^7.0.3",
50-
"heimdalljs": "^0.2.4",
51-
"heimdalljs-logger": "^0.1.9",
5250
"html-webpack-plugin": "^2.29.0",
5351
"karma-source-map-support": "^1.2.0",
5452
"less": "^2.7.2",

0 commit comments

Comments
 (0)