def test_logline_withdata(self): if six.PY2: check = self._check_logline( 'test:asdf:withdata one=1 two=u\'two\'') else: check = self._check_logline( 'test:asdf:withdata one=1 two=\'two\'') logline(check, 'test', 'asdf', 'withdata', one=1, two='two')
def log(self, name, kwargs, ret): """Implementing drivers should call this method to log the lookup transaction. :param name: The module name, e.g. ``__name__``. :type name: str :param kwargs: The keyword arguments given to :meth:`.lookup`. :type kwargs: dict :param ret: The return value of the lookup, e.g. a dictionary or ``None``. """ logger = logging.getLogger(name) operation = 'notfound' if ret is None else 'found' logline(logger.debug, 'lookup', id(self), operation, **kwargs)
def test_logline_nodata(self): check = self._check_logline('test:asdf:nodata') logline(check, 'test', 'asdf', 'nodata')