##// END OF EJS Templates
avoid race condition when deleting/starting sessions...
avoid race condition when deleting/starting sessions javascript doesn't guarantee the order of AJAX requests, so we give `Session.delete` and `Kernel.kill` a callback signature. Changing the kernel type calls `Notebook.start_kernel`, which terminates the previous session, if defined, before starting the new one. A flag is stored, to prevent multiple simultaneous attempts to start sessions, raising a SessionAlreadyStarting Error, preventing the spec_changed event from firing.

File last commit:

r17056:d21ad35d
r17649:fb1ac74c
Show More
log.py
25 lines | 643 B | text/x-python | PythonLexer
"""Grab the global logger instance."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import logging
_logger = None
def get_logger():
"""Grab the global logger instance.
If a global IPython Application is instantiated, grab its logger.
Otherwise, grab the root logger.
"""
global _logger
if _logger is None:
from IPython.config import Application
if Application.initialized():
_logger = Application.instance().log
else:
logging.basicConfig()
_logger = logging.getLogger()
return _logger