Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utilities run command not setting the right log level... #24

Closed
edickie opened this issue Aug 18, 2017 · 3 comments
Closed

utilities run command not setting the right log level... #24

edickie opened this issue Aug 18, 2017 · 3 comments
Assignees

Comments

@edickie
Copy link
Owner

edickie commented Aug 18, 2017

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??

@edickie
Copy link
Owner Author

edickie commented Aug 18, 2017

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??

@DESm1th
Copy link
Collaborator

DESm1th commented Aug 18, 2017

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.

@edickie
Copy link
Owner Author

edickie commented Sep 5, 2017

done..thanks Dawn

@edickie edickie closed this as completed Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants