How to use the cachecontrol.controller.logger function in CacheControl

To help you get started, we’ve selected a few CacheControl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github python-poetry / poetry / poetry / repositories / pypi_repository.py View on Github external
from poetry.utils.inspector import Inspector
from poetry.utils.patterns import wheel_file_re
from poetry.version.markers import InvalidMarker
from poetry.version.markers import parse_marker

from .exceptions import PackageNotFound
from .repository import Repository


try:
    import urllib.parse as urlparse
except ImportError:
    import urlparse


cache_control_logger.setLevel(logging.ERROR)

logger = logging.getLogger(__name__)


class PyPiRepository(Repository):

    CACHE_VERSION = parse_constraint("1.0.0")

    def __init__(self, url="https://pypi.org/", disable_cache=False, fallback=True):
        self._url = url
        self._disable_cache = disable_cache
        self._fallback = fallback

        release_cache_dir = Path(CACHE_DIR) / "cache" / "repositories" / "pypi"
        self._cache = CacheManager(
            {
github newsdev / elex / elex / cli / hooks.py View on Github external
def cachecontrol_logging_hook(app):
    """
    Reroute cachecontrol logger to use cement log handlers.
    """
    from cachecontrol.controller import logger
    formatter = logging.Formatter(LOG_FORMAT)

    for handler in app.log.backend.handlers:
        handler.setFormatter(formatter)
        logger.addHandler(handler)

    logger.setLevel(logging.DEBUG)
github ionrock / cachecontrol / cachecontrol / _cmd.py View on Github external
def setup_logging():
    logger.setLevel(logging.DEBUG)
    handler = logging.StreamHandler()
    logger.addHandler(handler)
github newsdev / elex / elex / cli / hooks.py View on Github external
def cachecontrol_logging_hook(app):
    """
    Reroute cachecontrol logger to use cement log handlers.
    """
    from cachecontrol.controller import logger
    formatter = logging.Formatter(LOG_FORMAT)

    for handler in app.log.backend.handlers:
        handler.setFormatter(formatter)
        logger.addHandler(handler)

    logger.setLevel(logging.DEBUG)
github ionrock / cachecontrol / cachecontrol / _cmd.py View on Github external
def setup_logging():
    logger.setLevel(logging.DEBUG)
    handler = logging.StreamHandler()
    logger.addHandler(handler)