Skip to content

Commit

Permalink
Merge pull request ipython#5379 from minrk/config-grr
Browse files Browse the repository at this point in the history
don't instantiate Application just for default logger
  • Loading branch information
takluyver committed Mar 19, 2014
2 parents d110b06 + 2a81bf9 commit 1943f33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion IPython/config/configurable.py
Expand Up @@ -26,6 +26,7 @@
# Imports
#-----------------------------------------------------------------------------

import logging
from copy import deepcopy

from .loader import Config, LazyConfigValue
Expand Down Expand Up @@ -381,6 +382,9 @@ class LoggingConfigurable(Configurable):
log = Instance('logging.Logger')
def _log_default(self):
from IPython.config.application import Application
return Application.instance().log
if Application.initialized():
return Application.instance().log
else:
return logging.getLogger()


6 changes: 5 additions & 1 deletion IPython/config/loader.py
Expand Up @@ -25,6 +25,7 @@

import argparse
import copy
import logging
import os
import re
import sys
Expand Down Expand Up @@ -308,7 +309,10 @@ class ConfigLoader(object):

def _log_default(self):
from IPython.config.application import Application
return Application.instance().log
if Application.initialized():
return Application.instance().log
else:
return logging.getLogger()

def __init__(self, log=None):
"""A base class for config loaders.
Expand Down

0 comments on commit 1943f33

Please sign in to comment.