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

Consider sending warnings to stderr #1306

Open
tokenrove opened this issue Aug 24, 2016 · 2 comments
Open

Consider sending warnings to stderr #1306

tokenrove opened this issue Aug 24, 2016 · 2 comments
Labels
dependency issue resides in a rebar3 dependency next major could only be changed in the next major version of rebar
Milestone

Comments

@tokenrove
Copy link
Contributor

Environment

Rebar3 report
 version 3.2.0
 generated at 2016-08-24T23:23:52+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: path
Entered as:
  path
-----------------
Operating System: x86_64-unknown-linux-gnu
ERTS: Erlang/OTP 18 [erts-7.3.1] [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
Root Directory: /usr/local/lib/erlang
Library directory: /usr/local/lib/erlang/lib
-----------------
Loaded Applications:
bbmustache: 1.0.4
certifi: 0.4.0
cf: 0.2.1
common_test: 1.13
compiler: 6.0.3
crypto: 3.6.3
cth_readable: 1.2.2
dialyzer: 2.9
edoc: 0.7.18
erlware_commons: 0.21.0
eunit: 2.2.13
eunit_formatters: 0.3.1
getopt: 0.8.2
inets: 6.2.3
kernel: 4.2
providers: 1.6.0
public_key: 1.1.1
relx: 3.19.0
sasl: 3.0
snmp: 5.2.2
ssl_verify_hostname: 1.0.5
stdlib: 2.8
syntax_tools: 1.7
tools: 2.8.3

-----------------
Escript path: /home/julian/bin/rebar3
Providers:
  app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit help install install_deps list lock new path pkgs release relup report shell state tar tree unlock update upgrade upgrade upgrade version xref

Current behaviour

The output of commands like rebar3 path, which would be useful in scripting contexts, cannot be used by other tools because their output is intermingled with warning messages (and colors).

Expected behaviour

It would be nice if ?WARN and friends went to stderr, at least if !isatty(stdin).

I looked into fixing this, but evidently the change needs to be made to erlware_commons; although the change is trivial, I can imagine changing a widely-used dependency might meet with some resistance. Still, it seems as if at least path, pkgs, and version could benefit from this. Right now, I have to use awful hacks to use these in shell scripting contexts.

(I imagine that the alternate suggestion is to run some invocation of rebar_agent through erl -eval, but it seems a shame to have a command-line tool and not to be able to use it directly in scripts.)

@ferd
Copy link
Collaborator

ferd commented Aug 25, 2016

Regarding the output of rebar3 path, you can use TERM=dumb to disable colors, and QUIET=1 to disable non-error logging, until anything is done about this.

I'm guessing we'd want to turn errors as well over stderr, if we were to do this.

@tsloughter I'd like to defer this one your way since it touches to erlware_commons.

@tokenrove
Copy link
Contributor Author

Thanks! TERM=dumb QUIET=1 is very helpful. It's still a bit brittle but much less so. (From a practical point of view, it's mostly the warnings which are unpredictable.)

@ferd ferd added the dependency issue resides in a rebar3 dependency label May 14, 2017
@ferd ferd added this to the Rebar4 milestone Apr 3, 2019
@ferd ferd added the next major could only be changed in the next major version of rebar label Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency issue resides in a rebar3 dependency next major could only be changed in the next major version of rebar
Projects
None yet
Development

No branches or pull requests

2 participants