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

logging error with the latest bluesky master #28

Open
mrakitin opened this issue Feb 25, 2020 · 2 comments
Open

logging error with the latest bluesky master #28

mrakitin opened this issue Feb 25, 2020 · 2 comments

Comments

@mrakitin
Copy link
Member

We observed this issue with @dmgav yesterday when we tried to debug multiruns issue on the latest master. It seems something is broken, either on the client side (likely), or on the library side (unlikely):

AttributeError                            Traceback (most recent call last)
/opt/conda_envs/collection-2020-1.0rc1/lib/python3.7/site-packages/IPython/core/shellapp.py in _exec_file(self, fname, shell_futures)
    338                                                  self.shell.user_ns,
    339                                                  shell_futures=shell_futures,
--> 340                                                  raise_exceptions=True)
    341         finally:
    342             sys.argv = save_argv

/opt/conda_envs/collection-2020-1.0rc1/lib/python3.7/site-packages/IPython/core/interactiveshell.py in safe_execfile(self, fname, exit_ignore, raise_exceptions, shell_futures, *where)
   2720                 py3compat.execfile(
   2721                     fname, glob, loc,
-> 2722                     self.compile if shell_futures else None)
   2723             except SystemExit as status:
   2724                 # If the call was made with 0 or None exit status (sys.exit(0)

/opt/conda_envs/collection-2020-1.0rc1/lib/python3.7/site-packages/IPython/utils/py3compat.py in execfile(fname, glob, loc, compiler)
    166     with open(fname, 'rb') as f:
    167         compiler = compiler or compile
--> 168         exec(compiler(f.read(), fname, 'exec'), glob, loc)
    169
    170 # Refactor print statements in doctests.

~/.ipython/profile_collection/startup/00-startup.py in <module>
      6
      7 from bluesky.log import current_handler
----> 8 current_handler.setLevel('CRITICAL')
      9
     10 # After the above call, you will now have the following in your namespace:

AttributeError: 'NoneType' object has no attribute 'setLevel'

Should we just remove these lines as they have to be different now?

cc @danielballan @ke-zhang-rd @tacaswell

@danielballan
Copy link
Contributor

The intended usage is:

from bluesky.log import config_bluesky_logging
config_bluesky_logging(level='CRITICAL')

The current_handler is a global module variable that is None at import time and will be set to a logger when (if) conifg_bluesky_logging is called.

@danielballan
Copy link
Contributor

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