Skip to content

Importing nipype changes external logging configuration #2569

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

Closed
jondeaton opened this issue May 9, 2018 · 1 comment
Closed

Importing nipype changes external logging configuration #2569

jondeaton opened this issue May 9, 2018 · 1 comment
Milestone

Comments

@jondeaton
Copy link

jondeaton commented May 9, 2018

Summary

If you have a python application that uses logging, importing nipype modifies your logging configuration. This results in multiple log messages being printed to the screen when you go to use the logger that you set up.

Actual behavior

Importing from nipype.interfaces.ants import N4BiasFieldCorrection reaults in log messages being printed to the console twice.

Expected behavior

When you import nipype, it should have no effect on any logging system in your application

How to replicate the behavior

import logging
from nipype.interfaces.ants import N4BiasFieldCorrection
logger = logging.getLogger('root')
logger.addHandler(logging.StreamHandler())
logger.warning("This should really only be appearing once...")

Script/Workflow details

N/a
Please put URL to code or code here (if not too long).

Platform details:

MacOS
Please paste the output of: python -c "import nipype; print(nipype.get_info()); print(nipype.__version__)"

{'pkg_path': '/Users/jonpdeaton/anaconda3/lib/python3.6/site-packages/nipype', 'commit_source': 'installation', 'commit_hash': '7d3966f', 'nipype_version': '1.0.3', 'sys_version': '3.6.4 |Anaconda custom (64-bit)| (default, Mar 12 2018, 20:05:31) \n[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]', 'sys_executable': '/Users/jonpdeaton/anaconda3/bin/python', 'sys_platform': 'darwin', 'numpy_version': '1.14.2', 'scipy_version': '0.19.1', 'networkx_version': '2.0', 'nibabel_version': '2.2.1', 'traits_version': '4.6.0'}
1.0.3

Execution environment

Anaconda, Python 3.6

Choose one

  • Container [Tag: ???]
  • My python environment inside container [Base Tag: ???]
  • My python environment outside container
@effigies
Copy link
Member

effigies commented Jul 2, 2018

@jondeaton Please reopen if the next release doesn't resolve your issue.

@effigies effigies added this to the 1.1.0 milestone Aug 30, 2018
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