Remove unwanted logging configuration
This commit is contained in:
parent
4672094212
commit
b406ecc515
10
README.md
10
README.md
|
@ -584,7 +584,15 @@ Logging
|
|||
|
||||
Injector uses standard :mod:`logging` module, the logger name is ``injector``.
|
||||
|
||||
By default ``injector`` logger is configured to use :class:`logging.NullHandler`.
|
||||
By default ``injector`` logger is not configured to print logs anywhere.
|
||||
|
||||
To enable ``get()`` tracing you need to set ``injector`` logger level to ``DEBUG``. You can do that programatically by executing:
|
||||
|
||||
```pycon
|
||||
import logging
|
||||
|
||||
logging.getLogger('injector').setLevel(logging.DEBUG)
|
||||
```
|
||||
|
||||
Thread safety
|
||||
-------------
|
||||
|
|
|
@ -37,11 +37,8 @@ __author__ = 'Alec Thomas <alec@swapoff.org>'
|
|||
__version__ = '0.7.4'
|
||||
__version_tag__ = ''
|
||||
|
||||
# To enable get() tracing, getLogger('injector').setLevel(logging.INFO)
|
||||
# To enable debug logging, setLevel(logging.DEBUG).
|
||||
log = logging.getLogger('injector')
|
||||
log.addHandler(NullHandler())
|
||||
log.setLevel(logging.WARNING)
|
||||
|
||||
|
||||
def synchronized(lock):
|
||||
|
@ -561,9 +558,9 @@ class Injector(object):
|
|||
raise Error('%s; scopes must be explicitly bound '
|
||||
'with Binder.bind_scope(scope_cls)' % e)
|
||||
|
||||
log.info('%sInjector.get(%r, annotation=%r, scope=%r) using %r', self._log_prefix, interface, annotation, scope, binding.provider)
|
||||
log.debug('%sInjector.get(%r, annotation=%r, scope=%r) using %r', self._log_prefix, interface, annotation, scope, binding.provider)
|
||||
result = scope_instance.get(key, binding.provider).get()
|
||||
log.info('%s -> %r', self._log_prefix, result)
|
||||
log.debug('%s -> %r', self._log_prefix, result)
|
||||
return result
|
||||
|
||||
def create_child_injector(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue