We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
The output stream should be STDOUT by default, as shown in train.py:
train.py
logging.basicConfig( format="%(asctime)s | %(levelname)s | %(name)s | %(message)s", datefmt="%Y-%m-%d %H:%M:%S", level=os.environ.get("LOGLEVEL", "INFO").upper(), stream=sys.stdout, )
However after import fairseq, the default output stream becomes STDERR. I cannot figure out why.
import fairseq
Steps to reproduce the behavior (always include the command you ran):
fairseq-train ... > output.txt
cat output.txt
A simple way to reproduce:
log_test1.py:
log_test1.py
import logging, sys logging.basicConfig(level='INFO', stream=sys.stdout) logging.info('hello')
Run python log_test1.py > output.txt, the content in output.txt is INFO:root:hello.
python log_test1.py > output.txt
output.txt
INFO:root:hello
log_test2.py:
log_test2.py
import logging, sys, fairseq logging.basicConfig(level='INFO', stream=sys.stdout) logging.info('hello')
Run python log_test1.py > output.txt, the content in output.txt is empty while the stderr prints 2020-12-21 10:48:39 | INFO | root | hello.
2020-12-21 10:48:39 | INFO | root | hello
Redirect all loggings to STDOUT so that we can distinguish infos and errors with different logging files.
pip
The text was updated successfully, but these errors were encountered:
Fixed in 0.10.2
Sorry, something went wrong.
myleott
No branches or pull requests
🐛 Bug
The output stream should be STDOUT by default, as shown in
train.py
:However after
import fairseq
, the default output stream becomes STDERR. I cannot figure out why.To Reproduce
Steps to reproduce the behavior (always include the command you ran):
fairseq-train ... > output.txt
cat output.txt
with empty content.Code sample
A simple way to reproduce:
log_test1.py
:Run
python log_test1.py > output.txt
, the content inoutput.txt
isINFO:root:hello
.log_test2.py
:Run
python log_test1.py > output.txt
, the content inoutput.txt
is empty while the stderr prints2020-12-21 10:48:39 | INFO | root | hello
.Expected behavior
Redirect all loggings to STDOUT so that we can distinguish infos and errors with different logging files.
Environment
pip
, source):Additional context
The text was updated successfully, but these errors were encountered: