##// END OF EJS Templates
don't instantiate Application just for default logger...
MinRK -
Show More
@@ -26,6 +26,7 b' from __future__ import print_function'
26 # Imports
26 # Imports
27 #-----------------------------------------------------------------------------
27 #-----------------------------------------------------------------------------
28
28
29 import logging
29 from copy import deepcopy
30 from copy import deepcopy
30
31
31 from .loader import Config, LazyConfigValue
32 from .loader import Config, LazyConfigValue
@@ -381,6 +382,9 b' class LoggingConfigurable(Configurable):'
381 log = Instance('logging.Logger')
382 log = Instance('logging.Logger')
382 def _log_default(self):
383 def _log_default(self):
383 from IPython.config.application import Application
384 from IPython.config.application import Application
384 return Application.instance().log
385 if Application.initialized():
386 return Application.instance().log
387 else:
388 return logging.getLogger()
385
389
386
390
@@ -25,6 +25,7 b' Authors'
25
25
26 import argparse
26 import argparse
27 import copy
27 import copy
28 import logging
28 import os
29 import os
29 import re
30 import re
30 import sys
31 import sys
@@ -308,7 +309,10 b' class ConfigLoader(object):'
308
309
309 def _log_default(self):
310 def _log_default(self):
310 from IPython.config.application import Application
311 from IPython.config.application import Application
311 return Application.instance().log
312 if Application.initialized():
313 return Application.instance().log
314 else:
315 return logging.getLogger()
312
316
313 def __init__(self, log=None):
317 def __init__(self, log=None):
314 """A base class for config loaders.
318 """A base class for config loaders.
General Comments 0
You need to be logged in to leave comments. Login now