prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add log message to get_user_config function
  there should be debug message for cases when default config overwrites user_config. 
  Currently, it is done silently.
  
  </issue>
  <code>
  [start of cookiecutter/config.py]
  1 # -*- coding: utf-8 -*-
  2 
  3 """Global configuration handling."""
  4 
  5 from __future__ import unicode_literals
  6 import copy
  7 import logging
  8 import os
  9 import io
  10 import collections
  11 
  12 import poyo
  13 
  14 from cookiecutter.exceptions import ConfigDoesNotExistException
  15 from cookiecutter.exceptions import InvalidConfiguration
  16 
  17 
  18 logger = logging.getLogger(__name__)
  19 
  20 USER_CONFIG_PATH = os.path.expanduser('~/.cookiecutterrc')
  21 
  22 BUILTIN_ABBREVIATIONS = {
  23     'gh': 'https://github.com/{0}.git',
  24     'gl': 'https://gitlab.com/{0}.git',
  25     'bb': 'https://bitbucket.org/{0}',
  26 }
  27 
  28 DEFAULT_CONFIG = {
  29     'cookiecutters_dir': os.path.expanduser('~/.cookiecutters/'),
  30     'replay_dir': os.path.expanduser('~/.cookiecutter_replay/'),
  31     'default_context': collections.OrderedDict([]),
  32     'abbreviations': BUILTIN_ABBREVIATIONS,
  33 }
  34 
  35 
  36 def _expand_path(path):
  37     """Expand both environment variables and user home in the given path."""
  38     path = os.path.expandvars(path)
  39     path = os.path.expanduser(path)
  40     return path
  41 
  42 
  43 def merge_configs(default, overwrite):
  44     """Recursively update a dict with the key/value pair of another.
  45 
  46     Dict values that are dictionaries themselves will be updated, whilst
  47     preserving existing keys.
  48     """
  49     new_config = copy.deepcopy(default)
  50 
  51     for k, v in overwrite.items():
  52         # Make sure to preserve existing items in
  53         # nested dicts, for example `abbreviations`
  54         if isinstance(v, dict):
  55             new_config[k] = merge_configs(default[k], v)
  56         else:
  57             new_config[k] = v
  58 
  59     return new_config
  60 
  61 
  62 def get_config(config_path):
  63     """Retrieve the config from the specified path, returning a config dict."""
  64     if not os.path.exists(config_path):
  65         raise ConfigDoesNotExistException
  66 
  67     logger.debug('config_path is %s', config_path)
  68     with io.open(config_path, encoding='utf-8') as file_handle:
  69         try:
  70             yaml_dict = poyo.parse_string(file_handle.read())
  71         except poyo.exceptions.PoyoException as e:
  72             raise InvalidConfiguration(
  73                 'Unable to parse YAML file {}. Error: {}'
  74                 ''.format(config_path, e)
  75             )
  76 
  77     config_dict = merge_configs(DEFAULT_CONFIG, yaml_dict)
  78 
  79     raw_replay_dir = config_dict['replay_dir']
  80     config_dict['replay_dir'] = _expand_path(raw_replay_dir)
  81 
  82     raw_cookies_dir = config_dict['cookiecutters_dir']
  83     config_dict['cookiecutters_dir'] = _expand_path(raw_cookies_dir)
  84 
  85     return config_dict
  86 
  87 
  88 def get_user_config(config_file=None, default_config=False):
  89     """Return the user config as a dict.
  90 
  91     If ``default_config`` is True, ignore ``config_file`` and return default
  92     values for the config parameters.
  93 
  94     If a path to a ``config_file`` is given, that is different from the default
  95     location, load the user config from that.
  96 
  97     Otherwise look up the config file path in the ``COOKIECUTTER_CONFIG``
  98     environment variable. If set, load the config from this path. This will
  99     raise an error if the specified path is not valid.
  100 
  101     If the environment variable is not set, try the default config file path
  102     before falling back to the default config values.
  103     """
  104     # Do NOT load a config. Return defaults instead.
  105     if default_config:
  106         return copy.copy(DEFAULT_CONFIG)
  107 
  108     # Load the given config file
  109     if config_file and config_file is not USER_CONFIG_PATH:
  110         return get_config(config_file)
  111 
  112     try:
  113         # Does the user set up a config environment variable?
  114         env_config_file = os.environ['COOKIECUTTER_CONFIG']
  115     except KeyError:
  116         # Load an optional user config if it exists
  117         # otherwise return the defaults
  118         if os.path.exists(USER_CONFIG_PATH):
  119             return get_config(USER_CONFIG_PATH)
  120         else:
  121             return copy.copy(DEFAULT_CONFIG)
  122     else:
  123         # There is a config environment variable. Try to load it.
  124         # Do not check for existence, so invalid file paths raise an error.
  125         return get_config(env_config_file)
  126
  [end of cookiecutter/config.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/cookiecutter/config.py b/cookiecutter/config.py
  --- a/cookiecutter/config.py
  +++ b/cookiecutter/config.py
  @@ -103,10 +103,12 @@
       """
       # Do NOT load a config. Return defaults instead.
       if default_config:
  +        logger.debug("Force ignoring user config with default_config switch.")
           return copy.copy(DEFAULT_CONFIG)
   
       # Load the given config file
       if config_file and config_file is not USER_CONFIG_PATH:
  +        logger.debug("Loading custom config from %s.", config_file)
           return get_config(config_file)
   
       try:
  @@ -116,10 +118,13 @@
           # Load an optional user config if it exists
           # otherwise return the defaults
           if os.path.exists(USER_CONFIG_PATH):
  +            logger.debug("Loading config from %s.", USER_CONFIG_PATH)
               return get_config(USER_CONFIG_PATH)
           else:
  +            logger.debug("User config not found. Loading default config.")
               return copy.copy(DEFAULT_CONFIG)
       else:
           # There is a config environment variable. Try to load it.
           # Do not check for existence, so invalid file paths raise an error.
  +        logger.debug("User config not found or not specified. Loading default config.")
           return get_config(env_config_file)
  
verification_info: {"golden_diff": "diff --git a/cookiecutter/config.py b/cookiecutter/config.py\n--- a/cookiecutter/config.py\n+++ b/cookiecutter/config.py\n@@ -103,10 +103,12 @@\n     \"\"\"\n     # Do NOT load a config. Return defaults instead.\n     if default_config:\n+        logger.debug(\"Force ignoring user config with default_config switch.\")\n         return copy.copy(DEFAULT_CONFIG)\n \n     # Load the given config file\n     if config_file and config_file is not USER_CONFIG_PATH:\n+        logger.debug(\"Loading custom config from %s.\", config_file)\n         return get_config(config_file)\n \n     try:\n@@ -116,10 +118,13 @@\n         # Load an optional user config if it exists\n         # otherwise return the defaults\n         if os.path.exists(USER_CONFIG_PATH):\n+            logger.debug(\"Loading config from %s.\", USER_CONFIG_PATH)\n             return get_config(USER_CONFIG_PATH)\n         else:\n+            logger.debug(\"User config not found. Loading default config.\")\n             return copy.copy(DEFAULT_CONFIG)\n     else:\n         # There is a config environment variable. Try to load it.\n         # Do not check for existence, so invalid file paths raise an error.\n+        logger.debug(\"User config not found or not specified. Loading default config.\")\n         return get_config(env_config_file)\n", "issue": "Add log message to get_user_config function\nthere should be debug message for cases when default config overwrites user_config. \r\nCurrently, it is done silently.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n\"\"\"Global configuration handling.\"\"\"\n\nfrom __future__ import unicode_literals\nimport copy\nimport logging\nimport os\nimport io\nimport collections\n\nimport poyo\n\nfrom cookiecutter.exceptions import ConfigDoesNotExistException\nfrom cookiecutter.exceptions import InvalidConfiguration\n\n\nlogger = logging.getLogger(__name__)\n\nUSER_CONFIG_PATH = os.path.expanduser('~/.cookiecutterrc')\n\nBUILTIN_ABBREVIATIONS = {\n    'gh': 'https://github.com/{0}.git',\n    'gl': 'https://gitlab.com/{0}.git',\n    'bb': 'https://bitbucket.org/{0}',\n}\n\nDEFAULT_CONFIG = {\n    'cookiecutters_dir': os.path.expanduser('~/.cookiecutters/'),\n    'replay_dir': os.path.expanduser('~/.cookiecutter_replay/'),\n    'default_context': collections.OrderedDict([]),\n    'abbreviations': BUILTIN_ABBREVIATIONS,\n}\n\n\ndef _expand_path(path):\n    \"\"\"Expand both environment variables and user home in the given path.\"\"\"\n    path = os.path.expandvars(path)\n    path = os.path.expanduser(path)\n    return path\n\n\ndef merge_configs(default, overwrite):\n    \"\"\"Recursively update a dict with the key/value pair of another.\n\n    Dict values that are dictionaries themselves will be updated, whilst\n    preserving existing keys.\n    \"\"\"\n    new_config = copy.deepcopy(default)\n\n    for k, v in overwrite.items():\n        # Make sure to preserve existing items in\n        # nested dicts, for example `abbreviations`\n        if isinstance(v, dict):\n            new_config[k] = merge_configs(default[k], v)\n        else:\n            new_config[k] = v\n\n    return new_config\n\n\ndef get_config(config_path):\n    \"\"\"Retrieve the config from the specified path, returning a config dict.\"\"\"\n    if not os.path.exists(config_path):\n        raise ConfigDoesNotExistException\n\n    logger.debug('config_path is %s', config_path)\n    with io.open(config_path, encoding='utf-8') as file_handle:\n        try:\n            yaml_dict = poyo.parse_string(file_handle.read())\n        except poyo.exceptions.PoyoException as e:\n            raise InvalidConfiguration(\n                'Unable to parse YAML file {}. Error: {}'\n                ''.format(config_path, e)\n            )\n\n    config_dict = merge_configs(DEFAULT_CONFIG, yaml_dict)\n\n    raw_replay_dir = config_dict['replay_dir']\n    config_dict['replay_dir'] = _expand_path(raw_replay_dir)\n\n    raw_cookies_dir = config_dict['cookiecutters_dir']\n    config_dict['cookiecutters_dir'] = _expand_path(raw_cookies_dir)\n\n    return config_dict\n\n\ndef get_user_config(config_file=None, default_config=False):\n    \"\"\"Return the user config as a dict.\n\n    If ``default_config`` is True, ignore ``config_file`` and return default\n    values for the config parameters.\n\n    If a path to a ``config_file`` is given, that is different from the default\n    location, load the user config from that.\n\n    Otherwise look up the config file path in the ``COOKIECUTTER_CONFIG``\n    environment variable. If set, load the config from this path. This will\n    raise an error if the specified path is not valid.\n\n    If the environment variable is not set, try the default config file path\n    before falling back to the default config values.\n    \"\"\"\n    # Do NOT load a config. Return defaults instead.\n    if default_config:\n        return copy.copy(DEFAULT_CONFIG)\n\n    # Load the given config file\n    if config_file and config_file is not USER_CONFIG_PATH:\n        return get_config(config_file)\n\n    try:\n        # Does the user set up a config environment variable?\n        env_config_file = os.environ['COOKIECUTTER_CONFIG']\n    except KeyError:\n        # Load an optional user config if it exists\n        # otherwise return the defaults\n        if os.path.exists(USER_CONFIG_PATH):\n            return get_config(USER_CONFIG_PATH)\n        else:\n            return copy.copy(DEFAULT_CONFIG)\n    else:\n        # There is a config environment variable. Try to load it.\n        # Do not check for existence, so invalid file paths raise an error.\n        return get_config(env_config_file)\n", "path": "cookiecutter/config.py"}]}