The logging module should have an option to only stream to standard out/error rather than forcing a log file to disk.
In many HPC environments, the job controller capture both standard out and error to a text file. For many people, this is enough to debug their scripts if logging is redirected to those streams instead. Thus, logging to a file should be optional.
Describe the solution you'd like
Replace the logfile parameter in MDAnalysis.start_logging(logfile='MDAnalysis.log', version='2.1.0') with a stream parameter that acts like stream in logging.basicConfig
import logging
import sys
logging.basicConfig(
level=logging.INFO,
stream=sys.stdout,
format="%(asctime)s - %(levelname)s - %(message)s"
)
logging.info("This goes to stdout")
logging.error("This also goes to stdout")
Describe alternatives you've considered
You could wrap something elaborate with file steam redirection like in bash, but that is too complicated compared to this fix.
Additional context
The logging module should have an option to only stream to standard out/error rather than forcing a log file to disk.
In many HPC environments, the job controller capture both standard out and error to a text file. For many people, this is enough to debug their scripts if logging is redirected to those streams instead. Thus, logging to a file should be optional.
Describe the solution you'd like
Replace the
logfileparameter inMDAnalysis.start_logging(logfile='MDAnalysis.log', version='2.1.0')with astreamparameter that acts likestreaminlogging.basicConfigDescribe alternatives you've considered
You could wrap something elaborate with file steam redirection like in
bash, but that is too complicated compared to this fix.Additional context