Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

at-loader should log to STDERR, not STDOUT #461

Closed
jrop opened this issue Jul 7, 2017 · 5 comments
Closed

at-loader should log to STDERR, not STDOUT #461

jrop opened this issue Jul 7, 2017 · 5 comments

Comments

@jrop
Copy link

jrop commented Jul 7, 2017

First of all, thank you so much for an amazing WebPack loader! I have come to rely on it in many of my projects.

From what I can tell, logs are made to STDOUT in these places:

This is bad because in the case when I want JSON webpack output (webpack --json > stats.json), the outputted file will contain log-lines from at-loader:

For example: stats.json:

[at-loader] Using typescript@2.4.1 from typescript and "tsconfig.json" from /Users/jrapodac/Code/gillette/web-team/node/famweb/src/public/js/tsconfig.json.


[at-loader] Checking started in a separate process...

[at-loader] Ok, 0.701 sec.
{
  "errors": [],
  "warnings": [],
  "version": "3.1.0",
  "hash": "a6062a75e3771e641063",
  "time": 7721,
  "publicPath": "/js/"
}

Ideally, these logs would get routed to STDERR, and this issue would not occur.

@jrop
Copy link
Author

jrop commented Jul 7, 2017

Afterthought: I suppose that I could use {silent: true}, but I would like to keep the error reporting while being able to pipe webpack --json output to a file and trust that the output is valid.

@gitowiec
Copy link

What exact part of webpack.config.js I can put {silent:true} to make at-loader mute?
I am using Webpack 3.9.

@jrop
Copy link
Author

jrop commented Jun 11, 2018

@s-panferov
Copy link
Owner

Yesterday the new version with webpack-log was released, does it solve your problem?

@ypresto
Copy link

ypresto commented Nov 30, 2018

I'm using awesome-typescript-loader@5.2.1 and this issue still exists. Please reopen 🙏.
webpack-log depends on loglevelnext and it seems to call console.log() ... console.error() methods.

Note that in Node.js, only console.warn() and console.error() are written to STDERR.

$ node -e '"log,debug,info,warn,error".split(",").forEach(level => console[level](level))' > /dev/null
warn
error

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants