##// END OF EJS Templates
get default logger from Application.instance()
MinRK -
Show More
@@ -49,6 +49,7 b' except ImportError:'
49
49
50 from zmq.eventloop import ioloop
50 from zmq.eventloop import ioloop
51
51
52 from IPython.config.application import Application
52 from IPython.config.configurable import Configurable
53 from IPython.config.configurable import Configurable
53 from IPython.utils.text import EvalFormatter
54 from IPython.utils.text import EvalFormatter
54 from IPython.utils.traitlets import Any, Int, List, Unicode, Dict, Instance
55 from IPython.utils.traitlets import Any, Int, List, Unicode, Dict, Instance
@@ -107,7 +108,9 b' class BaseLauncher(Configurable):'
107 # the work_dir option.
108 # the work_dir option.
108 work_dir = Unicode(u'.')
109 work_dir = Unicode(u'.')
109 loop = Instance('zmq.eventloop.ioloop.IOLoop')
110 loop = Instance('zmq.eventloop.ioloop.IOLoop')
110 log = Instance('logging.Logger', ('root',))
111 log = Instance('logging.Logger')
112 def _log_default(self):
113 return Application.instance().log
111
114
112 start_data = Any()
115 start_data = Any()
113 stop_data = Any()
116 stop_data = Any()
@@ -19,6 +19,7 b' import sys'
19 import zmq
19 import zmq
20 from zmq.eventloop import ioloop, zmqstream
20 from zmq.eventloop import ioloop, zmqstream
21
21
22 from IPython.config.application import Application
22 from IPython.config.configurable import Configurable
23 from IPython.config.configurable import Configurable
23 from IPython.utils.traitlets import Int, Unicode, Instance, List
24 from IPython.utils.traitlets import Int, Unicode, Instance, List
24
25
@@ -34,7 +35,9 b' class LogWatcher(Configurable):'
34 This can subscribe to multiple topics, but defaults to all topics.
35 This can subscribe to multiple topics, but defaults to all topics.
35 """
36 """
36
37
37 log = Instance('logging.Logger', ('root',))
38 log = Instance('logging.Logger')
39 def _log_default(self):
40 return Application.instance().log
38
41
39 # configurables
42 # configurables
40 topics = List([''], config=True,
43 topics = List([''], config=True,
@@ -44,6 +44,7 b' We support a subset of mongodb operators:'
44
44
45 from datetime import datetime
45 from datetime import datetime
46
46
47 from IPython.config.application import Application
47 from IPython.config.configurable import Configurable
48 from IPython.config.configurable import Configurable
48
49
49 from IPython.utils.traitlets import Dict, Unicode, Instance
50 from IPython.utils.traitlets import Dict, Unicode, Instance
@@ -83,7 +84,9 b' class BaseDB(Configurable):'
83 """Empty Parent class so traitlets work on DB."""
84 """Empty Parent class so traitlets work on DB."""
84 # base configurable traits:
85 # base configurable traits:
85 session = Unicode("")
86 session = Unicode("")
86 log = Instance('logging.Logger', ('root',))
87 log = Instance('logging.Logger')
88 def _log_default(self):
89 return Application.instance().log
87
90
88 class DictDB(BaseDB):
91 class DictDB(BaseDB):
89 """Basic in-memory dict-based object for saving Task Records.
92 """Basic in-memory dict-based object for saving Task Records.
@@ -18,6 +18,7 b' import zmq'
18 from zmq.devices import ThreadDevice
18 from zmq.devices import ThreadDevice
19 from zmq.eventloop import ioloop, zmqstream
19 from zmq.eventloop import ioloop, zmqstream
20
20
21 from IPython.config.application import Application
21 from IPython.config.configurable import Configurable
22 from IPython.config.configurable import Configurable
22 from IPython.utils.traitlets import Set, Instance, CFloat
23 from IPython.utils.traitlets import Set, Instance, CFloat
23
24
@@ -58,7 +59,10 b' class HeartMonitor(Configurable):'
58 ' (in ms) [default: 100]',
59 ' (in ms) [default: 100]',
59 )
60 )
60
61
61 log = Instance('logging.Logger', ('root',))
62 log = Instance('logging.Logger')
63 def _log_default(self):
64 return Application.instance().log
65
62 pingstream=Instance('zmq.eventloop.zmqstream.ZMQStream')
66 pingstream=Instance('zmq.eventloop.zmqstream.ZMQStream')
63 pongstream=Instance('zmq.eventloop.zmqstream.ZMQStream')
67 pongstream=Instance('zmq.eventloop.zmqstream.ZMQStream')
64 loop = Instance('zmq.eventloop.ioloop.IOLoop')
68 loop = Instance('zmq.eventloop.ioloop.IOLoop')
@@ -31,6 +31,7 b' from zmq.utils import jsonapi'
31 from zmq.eventloop.ioloop import IOLoop
31 from zmq.eventloop.ioloop import IOLoop
32 from zmq.eventloop.zmqstream import ZMQStream
32 from zmq.eventloop.zmqstream import ZMQStream
33
33
34 from IPython.config.application import Application
34 from IPython.config.configurable import Configurable
35 from IPython.config.configurable import Configurable
35 from IPython.utils.importstring import import_item
36 from IPython.utils.importstring import import_item
36 from IPython.utils.jsonutil import extract_dates, squash_dates, date_default
37 from IPython.utils.jsonutil import extract_dates, squash_dates, date_default
@@ -79,7 +80,9 b' class SessionFactory(Configurable):'
79 and IOLoop.
80 and IOLoop.
80 """
81 """
81
82
82 log = Instance('logging.Logger', ('', logging.WARN))
83 log = Instance('logging.Logger')
84 def _log_default(self):
85 return Application.instance().log
83
86
84 logname = Unicode('')
87 logname = Unicode('')
85 def _logname_changed(self, name, old, new):
88 def _logname_changed(self, name, old, new):
General Comments 0
You need to be logged in to leave comments. Login now