Closed edickie closed 7 years ago
added a hack fix to this by making a little function to call the run function. This is because I wanted to 1) explicitly pass the logger stream in 2) explicitly pass the DRYRUN argument from the DRYRUN global variable
Also I added a setting we're the whole script dies when the subprocess exits with an error...maybe this should be a default for the run function itself??
Hey Erin,
I've finally got a working recipe for this.
First: logger needs to be set to be the logger for the whole package, not just the current script. This will let it capture logging from utilities and other scripts. So:
logger = logging.getLogger('ciftify')
Second: The logger needs to have it's log level set to be the 'highest' level. That is, it needs to be the level that catches the most logging output (debug in our case since we dont use any more verbose levels). So:
logger.setlevel(logging.DEBUG)
Third: From that point on, only modify the log level of specific handlers. So the stream handler can be changed to lower levels, but other handlers can still receive the debug log messages for the entire package.
I've fixed this in pull request #25
I also removed the logging argument from run, since it doesnt need to be passed around now.
done..thanks Dawn
The ciftify_recon_all.log ciftify_subject_fmri.log files aren't don't contain the "Running: cmd" sections..
They do contains the section headers, which are also at the info level...and error messages... so maybe the run function is internally resetting the log level??