Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logger.info() messages should not be sent to stderr #16940

Closed
1 of 15 tasks
fcrwx opened this issue Feb 11, 2020 · 6 comments
Closed
1 of 15 tasks

logger.info() messages should not be sent to stderr #16940

fcrwx opened this issue Feb 11, 2020 · 6 comments

Comments

@fcrwx
Copy link

fcrwx commented Feb 11, 2020

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No

Description

logger.info() statements from ngcc are sent to stderr causing the informational messages to be displayed (in red) as ERRORs under a maven build. Please see the rejected PR at angular/angular#35310 which documents the incorrect behavior. The ngcc team believes this should be fixed in the cli.

🔬 Minimal Reproduction

In maven's pom.xml:


  ...
  <execution>
    <id>npm angular build</id>
      <goals>
        <goal>npm</goal>
      </goals>
      <configuration>
        <arguments>run build-dev</arguments>
      </configuration>
  </execution>
  ...

In package.json:


    "scripts": {
        ...
        "build-dev": "ng build",
        ...
    },

🔥 Exception or Error

Output from maven build:


[INFO] > ng build
[INFO]
[ERROR]
[ERROR] Compiling @angular/core : module as esm5
[ERROR]
[ERROR] Compiling @angular/common : module as esm5
[ERROR]
[ERROR] Compiling @angular/platform-browser : module as esm5
[ERROR]
[ERROR] Compiling @angular/platform-browser-dynamic : module as esm5
[ERROR]
...

🌍 Your Environment




Angular CLI: 9.0.1
Node: 12.13.1
OS: darwin x64

Angular: 9.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router, upgrade
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.1
@angular-devkit/build-angular     0.900.1
@angular-devkit/build-optimizer   0.900.1
@angular-devkit/build-webpack     0.900.1
@angular-devkit/core              9.0.1
@angular-devkit/schematics        9.0.1
@angular/cli                      9.0.1
@angular/flex-layout              9.0.0-beta.29
@ngtools/webpack                  9.0.1
@schematics/angular               9.0.1
@schematics/update                0.900.1
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

Anything else relevant?

@alan-agius4
Copy link
Collaborator

Progress, diagnostic and status messages should be written to stderr. stdout should only be used for logs intended to be piped to another command.

//cc @clydin as he definitely has more stronger arguments why it should be stderr.

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Feb 11, 2020

Most likely we should offer a way to silence these, maybe hide the logs when using the no-progress or only show them in verbose mode.

Related to #16899

@clydin
Copy link
Member

clydin commented Feb 12, 2020

Is frontend-maven-plugin being used in that maven pom? If so, than version 1.8.0+ (changelog & related issue) appears to contain a fix so that it does not assume that anything written to stderr is an error. stderr is intended as a general vehicle for diagnostic information and should not be assumed to indicate an error.

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Feb 12, 2020
@fcrwx
Copy link
Author

fcrwx commented Feb 12, 2020

@clydin - Thank you! Upgrading frontend-maven-plugin from 1.7.6 to 1.8.0 resolves the issue:

[INFO] --- frontend-maven-plugin:1.8.0:npm (npm angular build) @ newton-frontend ---
[INFO] Running 'npm run build-dev' in /Users/kolson/dev/Newton/webapps/newton-frontend
[INFO]
[INFO] > [email protected] build-dev /Users/kolson/dev/Newton/webapps/newton-frontend
[INFO] > ng build
[INFO]
[INFO]
[INFO] Compiling @angular/core : module as esm5
[INFO]
[INFO] Compiling @angular/common : module as esm5
[INFO]
[INFO] Compiling @angular/platform-browser : module as esm5
[INFO]
[INFO] Compiling @angular/platform-browser-dynamic : module as esm5
[INFO]
[INFO] Compiling @angular/upgrade/static : module as esm5
...

@clydin clydin removed the needs: more info Reporter must clarify the issue label Feb 12, 2020
@clydin
Copy link
Member

clydin commented Feb 12, 2020

Good to hear. Since the issue appears to be resolved, I'm going to close.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants