Questions tagged [stderr]
The standard error output stream (stderr) is typically used by a program to output error messages or diagnostics.
stderr
1,428
questions
0
votes
0
answers
18
views
How to log Python exceptions to a file implicitly? [duplicate]
I am wondering if there is a mechanism to write Python exceptions to a log file without explicitly calling log.exception("oh!") in a try-except-block?
e.g. in this snippet I show two cases:
...
0
votes
0
answers
36
views
How does it work to ignore the redirects of stdout and stderr and write directly to console?
How does ssh ignore the redirect and write anyways to the console?
.\ssh.exe [email protected] -p 1022 -v > test.log 2>&1
Output shown on windows console (perhaps the same under linux?):
The ...
0
votes
0
answers
6
views
Std-err log files are not getting generated in tomcat for SLES. How to generate std-err log files?
Std-err log files are not getting generated in tomcat for SLES.
In windows i am able to see std-err log file, but SLES i cant see one. Is there a specific procedure that we must follow to enable std-...
2
votes
1
answer
75
views
Tee only STDERR in Powershell without red text
I am using powershell to run a program (pyinstaller) writes all of its progress output to STDERR. I want the output of this command to be both printed on to the console AND saved to a file.
First, I ...
0
votes
1
answer
43
views
python 3 using ffmpeg in a subprocess getting stderr decoding error
I am running ffmpeg as a subprocess and using the stderr to get various bits of data like the subtitles stream Id's. It works fine for most videos, but one with japanese subtitles results in an ...
0
votes
0
answers
29
views
Docker logs in Docker Python SDK: Distinction between `stdout` and `stderr` in correct order
I'm using Docker SDK for Python.
I need to stream the logs from my docker container for logging.
Currently I do this:
stream = container.logs(stdout=True, stderr=True, stream=True)
for line in stream:...
0
votes
1
answer
23
views
How to call `time` from python with its stderr returned only
How can I capture the output of /usr/bin/time only, if the command itself outputs stderr?
import subprocess
print(subprocess.run('/usr/bin/time -p foo', capture_output=True, shell=True).stderr.decode()...
0
votes
0
answers
21
views
Adding a prefix to all output lines of "apt-update && apt-upgrade in BASH? [duplicate]
I'm trying to add a prefix to all output of the following command:
sudo apt update && sudo apt -y upgrade
I've been scouring the internet and it seem there are 2 outputs to handle. STDOUT, and ...
5
votes
3
answers
113
views
log rotation problem on custom application
I have server program, written in C++. I usually start it as
db_net 2> log_file
I do not use anything special about logging, just print on stderr.
However sometimes, the log_file become huge. If I ...
0
votes
1
answer
38
views
How can I send specific messages to stdout from a bash prompt with multiple commands that is run via nohup?
I want to run multiple commands that are concatenated via && with nohup.
The output of the commands are redirected to nohup.out which is fine. But I want send some messages in between to ...
0
votes
3
answers
121
views
how to make fputs function prompt wrong input and ask user to input again...program stopping instead of request for new input
i'm doing calculation for result. user will input 3 type of result that is pass, fail & invalid. I need to have 1 more checking that is when user input result other than integer value it will be ...
2
votes
0
answers
133
views
Why doesn't this bash script print stdout on console when run as sudo?
Consider the following script:
#!/bin/bash
# Define a function to redirect both stdout and stderr
redirect_both_to() {
local log_file=logfile.log
exec > >(tee -a "$log_file") ...
0
votes
0
answers
243
views
relocation R_X86_64_TPOFF32 against hidden symbol `pkgcontext' can not be used when making a shared object
I am getting this error when ever I try to use <colcon build>,
The error is as followss:
/usr/bin/ld: /usr/local/lib/libpython3.12.a(import.o): relocation R_X86_64_TPOFF32 against hidden symbol `...
0
votes
0
answers
25
views
stdout and stderr to terminal and file - problems with git client 2.26.2 - strange characters [duplicate]
I use the following command to get stdout and stderr in the terminal and in a file:
git svn rebase 2>&1 | tee test.out
But in case of changes in svn repository 2>&1 causes strange ...
0
votes
1
answer
40
views
Reading stderr/stdout durring subprocess execution
I'm trying to run a command in python using the subprocces library and read the stderr during the execution.
As an example i have the following python file:
import time
if __name__ == "__main__&...