Skip to content

Commit 4cbf8cc

Browse files
bowennivsavkin
authored andcommitted
Keep console.log that are not called during compilation.
1 parent a6c4490 commit 4cbf8cc

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

modules/@angular/benchpress/test/firefox_extension/spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
/* tslint:disable:no-console */
910
import {browser} from 'protractor';
1011

1112
const assertEventsContainsName = function(events: any[], eventName: string) {
@@ -27,7 +28,9 @@ describe('firefox extension', function() {
2728

2829
browser.driver.get(TEST_URL);
2930

30-
browser.executeScript('window.startProfiler()');
31+
browser.executeScript('window.startProfiler()').then(function() {
32+
console.log('started measuring perf');
33+
});
3134

3235
browser.executeAsyncScript('setTimeout(arguments[0], 1000);');
3336
browser.executeScript('window.forceGC()');

modules/@angular/examples/_common/e2e_util.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8+
/* tslint:disable:no-console */
89
import * as webdriver from 'selenium-webdriver';
910
declare var browser: any;
1011
declare var expect: any;
@@ -15,6 +16,7 @@ export function verifyNoBrowserErrors() {
1516
const errors: any[] = [];
1617
browserLog.filter(logEntry => {
1718
const msg = logEntry.message;
19+
console.log('>> ' + msg);
1820
if (logEntry.level.value >= webdriver.logging.Level.INFO.value) {
1921
errors.push(msg);
2022
}

modules/benchmarks/src/util.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
/* tslint:disable:no-console */
910
urlParamsToForm();
1011

1112
export function getIntParameter(name: string) {
@@ -51,6 +52,7 @@ export function profile(create: () => void, destroy: () => void, name: string) {
5152
destroy();
5253
}
5354
window.console.profileEnd();
55+
window.console.log(`Iterations: ${count}; time: ${duration / count} ms / iteration`);
5456

5557
window.console.profile(name + ' w/o GC');
5658
duration = 0;
@@ -62,6 +64,7 @@ export function profile(create: () => void, destroy: () => void, name: string) {
6264
destroy();
6365
}
6466
window.console.profileEnd();
67+
window.console.log(`Iterations: ${count}; time: ${duration / count} ms / iteration`);
6568
};
6669
}
6770

modules/e2e_util/e2e_util.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
/* tslint:disable:no-console */
910
import {browser} from 'protractor';
1011

1112
const yargs = require('yargs');
@@ -59,7 +60,7 @@ export function verifyNoBrowserErrors() {
5960
browser.manage().logs().get('browser').then(function(browserLog: any) {
6061
const filteredLog = browserLog.filter(function(logEntry: any) {
6162
if (logEntry.level.value >= webdriver.logging.Level.INFO.value) {
62-
console.error('>> ' + logEntry.message);
63+
console.log('>> ' + logEntry.message);
6364
}
6465
return logEntry.level.value > webdriver.logging.Level.WARNING.value;
6566
});

tools/tsc-watch/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
/* tslint:disable:no-console */
910
import {spawn} from 'child_process';
1011
import {existsSync, mkdirSync, writeFileSync} from 'fs';
1112

@@ -21,9 +22,11 @@ function processOutputEmitterCodeGen(): Promise<number> {
2122
return new Promise((resolve, reject) => {
2223
const outDir = 'dist/all/@angular/compiler/test/';
2324
const promises: Promise<any>[] = [];
25+
console.log('Processing codegen...');
2426
OFFLINE_COMPILE.forEach((file: string) => {
2527
const codegen = require('../../all/@angular/compiler/test/' + file + '.js');
2628
if (codegen.emit) {
29+
console.log(` ${file} has changed, regenerating...`);
2730
promises.push(Promise.resolve(codegen.emit()).then((code) => {
2831
writeFileSync(outDir + file + '.ts', code);
2932
}));
@@ -34,6 +37,7 @@ function processOutputEmitterCodeGen(): Promise<number> {
3437
.then(() => {
3538
const args =
3639
['--project', 'tools/cjs-jasmine/tsconfig-output_emitter_codegen.json'];
40+
console.log(' compiling changes: tsc ' + args.join(' '));
3741
const tsc = spawn(TSC, args, {stdio: 'pipe'});
3842
tsc.stdout.on('data', (data: any) => process.stdout.write(data));
3943
tsc.stderr.on('data', (data: any) => process.stderr.write(data));

tools/tsc-watch/tsc_watch.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9+
/* tslint:disable:no-console */
910
import {spawn} from 'child_process';
1011
import {platform} from 'os';
1112
import {normalize} from 'path';
@@ -37,6 +38,7 @@ export class TscWatch {
3738
start: string,
3839
complete: string, onStartCmds?: Array<string[]|Command>, onChangeCmds?: Array<string[]|Command>
3940
}) {
41+
console.log('Watching:', tsconfig, 'in', process.cwd());
4042
this.tsconfig = tsconfig;
4143
this.start = start;
4244
this.error = error;
@@ -66,12 +68,14 @@ export class TscWatch {
6668
const args = argsOrCmd as Array<string>;
6769
return <any>new Promise((resolve, reject) => {
6870
const [cmd, ...options] = args;
71+
console.log('=====>', cmd, options.join(' '));
6972
const childProcess = spawn(cmd, options, {stdio: 'pipe'});
7073
childProcess.stdout.on('data', stdOut);
7174
childProcess.stderr.on('data', stdErr);
7275
const onExit = () => childProcess.kill();
7376
childProcess.on('close', (code: number) => {
7477
process.removeListener('exit', onExit);
78+
console.log('EXIT:', code, '<=====', args.join(' '));
7579
code ? reject(code) : resolve(code);
7680
});
7781
process.on('exit', onExit);
@@ -95,22 +99,23 @@ export class TscWatch {
9599
consumeLine(buffer: Buffer, isStdError: boolean) {
96100
const line = '' + buffer;
97101
if (contains(line, this.start)) {
102+
console.log('==============================================================================');
98103
stdOut(buffer, isStdError);
99104
this.state = State.waiting;
100105
} else if (contains(line, this.error)) {
101106
stdOut(buffer, isStdError);
102107
this.state = State.error;
103108
} else if (contains(line, this.complete)) {
104109
stdOut(buffer, isStdError);
110+
console.log('------------------------------------------------------------------------------');
105111
if (this.state == State.error) {
106-
console.error('Errors found.... (response not triggered)');
112+
console.log('Errors found.... (response not triggered)');
107113
if (this.runOnce) process.exit(1);
108114
this.state = State.idle;
109115
} else {
110116
if (this.triggered) {
111117
this.triggered.then(
112-
() => this.triggerCmds(),
113-
(e) => console.error('Error while running commands....', e));
118+
() => this.triggerCmds(), (e) => console.log('Error while running commands....', e));
114119
} else {
115120
this.triggerCmds();
116121
}

0 commit comments

Comments
 (0)