Closed tarekziade closed 12 years ago
the markup has screwed the second link. Should be init .py
Of course I'd do a new method in the client rather than a separate function, Something like:
def _get_handler(self):
if self._handler is None:
self._handler = MetlogHandler(self)
self._handler.setLevel(logging.DEBUG)
return self._handler
def hook_logger(self, name):
logging.getLogger(name).addHandler(self._get_handler())
i've taken your MetlogHandler and the hook and integrated it into metlog on a branch @ https://github.com/mozilla-services/metlog-py/commit/0bf8b1bce54bf214c18d3c034d42811fde8e139c
this is merged into master now
I need to intercept logs emited into logging by libraries. (powerhose, circus,etc)
here what I have done:
see: https://github.com/mozilla-services/tokenserver/blob/master/tokenserver/util.py#L83
use case: https://github.com/mozilla-services/tokenserver/blob/master/tokenserver/__init__.py#L33
Should I push a pull request ?