question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow option to suppress info messages that are sent to stderr

See original GitHub issue

As per https://github.com/pypa/pipenv/issues/628 and https://github.com/pypa/pipenv/pull/630, some output, e.g. courtesy notices and messages like

Loading .env environment variables…

are sent to stderr instead of stdout. This is somewhat unexpected behaviour as these are clearly not error messages. In fact, these messages are polluting some of our error logs. It would be really useful to have an option to completely suppress these messages, e.g. by allowing the --bare flag for the run and shell commands.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
kennethreitzcommented, Mar 13, 2018

disagree 😃

1reaction
vlsdcommented, Jan 30, 2020

redirect them Sent from my iPhone On Jan 24, 2020, at 1:04 PM, Vlad @.***> wrote:  @kennethreitz is there any mechanism to either suppress this message or redirect it to stdout? a lot of unix tools (cron, most importantly) interpret any output to stderr as an actual error, meaning anything running with pipenv will be interpreted as having errored out — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

i don’t want to redirect all of my stderr though, just this one message; one can do what @sudeshjethoe suggested and pipe stderr into grep -v then pipe the stdout of that back to stderr, all the while redirecting stdout to null, but it seems like a really convoluted (and limiting) solution for removing a non-critical message from stderr

for anyone else looking to do this, here’s my current solution:

# pipenv run python script.py 2> >(grep -v "Loading .env environment variables" 1>&2)

which I found courtesy of this SO answer https://stackoverflow.com/a/15936384/912015

Read more comments on GitHub >

github_iconTop Results From Across the Web

suppress stderr messages in a bash script
You're right; pkill isn't generating the message, bash is. You suggest that $ ./test1.sh 2> /dev/null. is a possible solution.
Read more >
Python Recipes- Suppress Stdout And Stderr Messages
Python recipes to suppress stdout and stderr messages into devnull or your own log file via context manager.
Read more >
Suppress output to stderr in matlab - logging - Stack Overflow
The problem here is, that in the matlab command line call, the output from STDERR is streamed to STDOUT by this "command": 2>&1...
Read more >
How do I suppress INFO and WARNING messages when c ...
I am making a connection to Hive in Java with the following: Connection conn = DriverManager.getConnection(connectionUrl, userName, password);.
Read more >
Spark - Stop INFO & DEBUG message logging to console?
Problem: In Spark, wondering how to stop/disable/turn off INFO and DEBUG message logging to Spark console, when I run a Spark or PySpark ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found