def wrappedfunc(nb, resources):
     from IPython.config import Application
     if Application.initialized():
         Application.instance().log.debug(
             "Applying preprocessor: %s", function.__name__
         )
     for worksheet in nb.worksheets:
         for index, cell in enumerate(worksheet.cells):
             worksheet.cells[index], resources = function(cell, resources, index)
     return nb, resources
Esempio n. 2
0
 def wrappedfunc(nb, resources):
     from IPython.config import Application
     if Application.initialized():
         Application.instance().log.debug("Applying preprocessor: %s",
                                          function.__name__)
     for worksheet in nb.worksheets:
         for index, cell in enumerate(worksheet.cells):
             worksheet.cells[index], resources = function(
                 cell, resources, index)
     return nb, resources
Esempio n. 3
0
def _logger():
    """get the logger for the current Application
    
    the root logger will be used if no Application is running
    """
    if Application.initialized():
        logger = Application.instance().log
    else:
        logger = logging.getLogger()
        if not logger.handlers:
            logging.basicConfig()

    return logger
Esempio n. 4
0
def _logger():
    """get the logger for the current Application
    
    the root logger will be used if no Application is running
    """
    if Application.initialized():
        logger = Application.instance().log
    else:
        logger = logging.getLogger()
        if not logger.handlers:
            logging.basicConfig()
    
    return logger
Esempio n. 5
0
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
Esempio n. 6
0
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
Esempio n. 7
0
 def log(self):
     """use the IPython log by default, falling back on tornado's logger"""
     if Application.initialized():
         return Application.instance().log
     else:
         return app_log
Esempio n. 8
0
 def log(self):
     """use the IPython log by default, falling back on tornado's logger"""
     if Application.initialized():
         return Application.instance().log
     else:
         return app_log