prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
   Docker image making logfiles in user_data
  docker image places error logfiles in user_data by default. (apparently it should not be doing that)
  Maybe cud have it put them in a log dir?
  
  
  docker-compose.yml
  
  command: >
        trade
        --logfile /freqtrade/user_data/freqtrade.log
  
  can maybe be changed to 
        --logfile /freqtrade/user_data/log/freqtrade.log
  
  
  </issue>
  <code>
  [start of freqtrade/configuration/directory_operations.py]
  1 import logging
  2 import shutil
  3 from pathlib import Path
  4 from typing import Any, Dict, Optional
  5 
  6 from freqtrade.exceptions import OperationalException
  7 from freqtrade.constants import USER_DATA_FILES
  8 
  9 logger = logging.getLogger(__name__)
  10 
  11 
  12 def create_datadir(config: Dict[str, Any], datadir: Optional[str] = None) -> Path:
  13 
  14     folder = Path(datadir) if datadir else Path(f"{config['user_data_dir']}/data")
  15     if not datadir:
  16         # set datadir
  17         exchange_name = config.get('exchange', {}).get('name').lower()
  18         folder = folder.joinpath(exchange_name)
  19 
  20     if not folder.is_dir():
  21         folder.mkdir(parents=True)
  22         logger.info(f'Created data directory: {datadir}')
  23     return folder
  24 
  25 
  26 def create_userdata_dir(directory: str, create_dir: bool = False) -> Path:
  27     """
  28     Create userdata directory structure.
  29     if create_dir is True, then the parent-directory will be created if it does not exist.
  30     Sub-directories will always be created if the parent directory exists.
  31     Raises OperationalException if given a non-existing directory.
  32     :param directory: Directory to check
  33     :param create_dir: Create directory if it does not exist.
  34     :return: Path object containing the directory
  35     """
  36     sub_dirs = ["backtest_results", "data", "hyperopts", "hyperopt_results", "notebooks",
  37                 "plot", "strategies", ]
  38     folder = Path(directory)
  39     if not folder.is_dir():
  40         if create_dir:
  41             folder.mkdir(parents=True)
  42             logger.info(f'Created user-data directory: {folder}')
  43         else:
  44             raise OperationalException(
  45                 f"Directory `{folder}` does not exist. "
  46                 "Please use `freqtrade create-userdir` to create a user directory")
  47 
  48     # Create required subdirectories
  49     for f in sub_dirs:
  50         subfolder = folder / f
  51         if not subfolder.is_dir():
  52             subfolder.mkdir(parents=False)
  53     return folder
  54 
  55 
  56 def copy_sample_files(directory: Path, overwrite: bool = False) -> None:
  57     """
  58     Copy files from templates to User data directory.
  59     :param directory: Directory to copy data to
  60     :param overwrite: Overwrite existing sample files
  61     """
  62     if not directory.is_dir():
  63         raise OperationalException(f"Directory `{directory}` does not exist.")
  64     sourcedir = Path(__file__).parents[1] / "templates"
  65     for source, target in USER_DATA_FILES.items():
  66         targetdir = directory / target
  67         if not targetdir.is_dir():
  68             raise OperationalException(f"Directory `{targetdir}` does not exist.")
  69         targetfile = targetdir / source
  70         if targetfile.exists():
  71             if not overwrite:
  72                 logger.warning(f"File `{targetfile}` exists already, not deploying sample file.")
  73                 continue
  74             else:
  75                 logger.warning(f"File `{targetfile}` exists already, overwriting.")
  76         shutil.copy(str(sourcedir / source), str(targetfile))
  77
  [end of freqtrade/configuration/directory_operations.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/freqtrade/configuration/directory_operations.py b/freqtrade/configuration/directory_operations.py
  --- a/freqtrade/configuration/directory_operations.py
  +++ b/freqtrade/configuration/directory_operations.py
  @@ -33,8 +33,8 @@
       :param create_dir: Create directory if it does not exist.
       :return: Path object containing the directory
       """
  -    sub_dirs = ["backtest_results", "data", "hyperopts", "hyperopt_results", "notebooks",
  -                "plot", "strategies", ]
  +    sub_dirs = ["backtest_results", "data", "hyperopts", "hyperopt_results", "logs",
  +                "notebooks", "plot", "strategies", ]
       folder = Path(directory)
       if not folder.is_dir():
           if create_dir:
  
verification_info: {"golden_diff": "diff --git a/freqtrade/configuration/directory_operations.py b/freqtrade/configuration/directory_operations.py\n--- a/freqtrade/configuration/directory_operations.py\n+++ b/freqtrade/configuration/directory_operations.py\n@@ -33,8 +33,8 @@\n     :param create_dir: Create directory if it does not exist.\n     :return: Path object containing the directory\n     \"\"\"\n-    sub_dirs = [\"backtest_results\", \"data\", \"hyperopts\", \"hyperopt_results\", \"notebooks\",\n-                \"plot\", \"strategies\", ]\n+    sub_dirs = [\"backtest_results\", \"data\", \"hyperopts\", \"hyperopt_results\", \"logs\",\n+                \"notebooks\", \"plot\", \"strategies\", ]\n     folder = Path(directory)\n     if not folder.is_dir():\n         if create_dir:\n", "issue": " Docker image making logfiles in user_data\ndocker image places error logfiles in user_data by default. (apparently it should not be doing that)\r\nMaybe cud have it put them in a log dir?\r\n\r\n\r\ndocker-compose.yml\r\n\r\ncommand: >\r\n      trade\r\n      --logfile /freqtrade/user_data/freqtrade.log\r\n\r\ncan maybe be changed to \r\n      --logfile /freqtrade/user_data/log/freqtrade.log\r\n\n", "before_files": [{"content": "import logging\nimport shutil\nfrom pathlib import Path\nfrom typing import Any, Dict, Optional\n\nfrom freqtrade.exceptions import OperationalException\nfrom freqtrade.constants import USER_DATA_FILES\n\nlogger = logging.getLogger(__name__)\n\n\ndef create_datadir(config: Dict[str, Any], datadir: Optional[str] = None) -> Path:\n\n    folder = Path(datadir) if datadir else Path(f\"{config['user_data_dir']}/data\")\n    if not datadir:\n        # set datadir\n        exchange_name = config.get('exchange', {}).get('name').lower()\n        folder = folder.joinpath(exchange_name)\n\n    if not folder.is_dir():\n        folder.mkdir(parents=True)\n        logger.info(f'Created data directory: {datadir}')\n    return folder\n\n\ndef create_userdata_dir(directory: str, create_dir: bool = False) -> Path:\n    \"\"\"\n    Create userdata directory structure.\n    if create_dir is True, then the parent-directory will be created if it does not exist.\n    Sub-directories will always be created if the parent directory exists.\n    Raises OperationalException if given a non-existing directory.\n    :param directory: Directory to check\n    :param create_dir: Create directory if it does not exist.\n    :return: Path object containing the directory\n    \"\"\"\n    sub_dirs = [\"backtest_results\", \"data\", \"hyperopts\", \"hyperopt_results\", \"notebooks\",\n                \"plot\", \"strategies\", ]\n    folder = Path(directory)\n    if not folder.is_dir():\n        if create_dir:\n            folder.mkdir(parents=True)\n            logger.info(f'Created user-data directory: {folder}')\n        else:\n            raise OperationalException(\n                f\"Directory `{folder}` does not exist. \"\n                \"Please use `freqtrade create-userdir` to create a user directory\")\n\n    # Create required subdirectories\n    for f in sub_dirs:\n        subfolder = folder / f\n        if not subfolder.is_dir():\n            subfolder.mkdir(parents=False)\n    return folder\n\n\ndef copy_sample_files(directory: Path, overwrite: bool = False) -> None:\n    \"\"\"\n    Copy files from templates to User data directory.\n    :param directory: Directory to copy data to\n    :param overwrite: Overwrite existing sample files\n    \"\"\"\n    if not directory.is_dir():\n        raise OperationalException(f\"Directory `{directory}` does not exist.\")\n    sourcedir = Path(__file__).parents[1] / \"templates\"\n    for source, target in USER_DATA_FILES.items():\n        targetdir = directory / target\n        if not targetdir.is_dir():\n            raise OperationalException(f\"Directory `{targetdir}` does not exist.\")\n        targetfile = targetdir / source\n        if targetfile.exists():\n            if not overwrite:\n                logger.warning(f\"File `{targetfile}` exists already, not deploying sample file.\")\n                continue\n            else:\n                logger.warning(f\"File `{targetfile}` exists already, overwriting.\")\n        shutil.copy(str(sourcedir / source), str(targetfile))\n", "path": "freqtrade/configuration/directory_operations.py"}]}