prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  PTVSD_LOG_DIR doesn't work with VS
  No logs are generated even with the environment variable set. It looks like logging initialization is missing on the VS entry point (`debugger.py`).
  
  </issue>
  <code>
  [start of src/ptvsd/debugger.py]
  1 # Copyright (c) Microsoft Corporation. All rights reserved.
  2 # Licensed under the MIT License. See LICENSE in the project root
  3 # for license information.
  4 
  5 import sys
  6 
  7 from ptvsd._local import run_module, run_file, run_main
  8 
  9 
  10 # TODO: not needed?
  11 DONT_DEBUG = []
  12 
  13 LOCALHOST = 'localhost'
  14 
  15 RUNNERS = {
  16     'module': run_module,  # python -m spam
  17     'script': run_file,  # python spam.py
  18     'code': run_file,  # python -c 'print("spam")'
  19     None: run_file,  # catchall
  20 }
  21 
  22 
  23 def debug(filename, port_num, debug_id, debug_options, run_as,
  24           _runners=RUNNERS, _extra=None, *args, **kwargs):
  25     # TODO: docstring
  26     if _extra is None:
  27         _extra = sys.argv[1:]
  28     address = (LOCALHOST, port_num)
  29     try:
  30         run = _runners[run_as]
  31     except KeyError:
  32         # TODO: fail?
  33         run = _runners[None]
  34     if _extra:
  35         args = _extra + list(args)
  36     kwargs.setdefault('singlesession', True)
  37     run(address, filename, *args, **kwargs)
  38 
  39 
  40 def run(filename, port_num, run_as,
  41         *args, **kwargs):
  42     address = (LOCALHOST, port_num)
  43     run_main(address, filename, run_as, *args, **kwargs)
  44
  [end of src/ptvsd/debugger.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/src/ptvsd/debugger.py b/src/ptvsd/debugger.py
  --- a/src/ptvsd/debugger.py
  +++ b/src/ptvsd/debugger.py
  @@ -4,6 +4,7 @@
   
   import sys
   
  +import ptvsd.log
   from ptvsd._local import run_module, run_file, run_main
   
   
  @@ -22,7 +23,10 @@
   
   def debug(filename, port_num, debug_id, debug_options, run_as,
             _runners=RUNNERS, _extra=None, *args, **kwargs):
  -    # TODO: docstring
  +
  +    ptvsd.log.to_file()
  +    ptvsd.log.info('debug{0!r}', (filename, port_num, debug_id, debug_options, run_as))
  +
       if _extra is None:
           _extra = sys.argv[1:]
       address = (LOCALHOST, port_num)
  @@ -39,5 +43,9 @@
   
   def run(filename, port_num, run_as,
           *args, **kwargs):
  +
  +    ptvsd.log.to_file()
  +    ptvsd.log.info('run{0!r}', (filename, port_num, run_as))
  +
       address = (LOCALHOST, port_num)
       run_main(address, filename, run_as, *args, **kwargs)
  
verification_info: {"golden_diff": "diff --git a/src/ptvsd/debugger.py b/src/ptvsd/debugger.py\n--- a/src/ptvsd/debugger.py\n+++ b/src/ptvsd/debugger.py\n@@ -4,6 +4,7 @@\n \n import sys\n \n+import ptvsd.log\n from ptvsd._local import run_module, run_file, run_main\n \n \n@@ -22,7 +23,10 @@\n \n def debug(filename, port_num, debug_id, debug_options, run_as,\n           _runners=RUNNERS, _extra=None, *args, **kwargs):\n-    # TODO: docstring\n+\n+    ptvsd.log.to_file()\n+    ptvsd.log.info('debug{0!r}', (filename, port_num, debug_id, debug_options, run_as))\n+\n     if _extra is None:\n         _extra = sys.argv[1:]\n     address = (LOCALHOST, port_num)\n@@ -39,5 +43,9 @@\n \n def run(filename, port_num, run_as,\n         *args, **kwargs):\n+\n+    ptvsd.log.to_file()\n+    ptvsd.log.info('run{0!r}', (filename, port_num, run_as))\n+\n     address = (LOCALHOST, port_num)\n     run_main(address, filename, run_as, *args, **kwargs)\n", "issue": "PTVSD_LOG_DIR doesn't work with VS\nNo logs are generated even with the environment variable set. It looks like logging initialization is missing on the VS entry point (`debugger.py`).\n", "before_files": [{"content": "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See LICENSE in the project root\n# for license information.\n\nimport sys\n\nfrom ptvsd._local import run_module, run_file, run_main\n\n\n# TODO: not needed?\nDONT_DEBUG = []\n\nLOCALHOST = 'localhost'\n\nRUNNERS = {\n    'module': run_module,  # python -m spam\n    'script': run_file,  # python spam.py\n    'code': run_file,  # python -c 'print(\"spam\")'\n    None: run_file,  # catchall\n}\n\n\ndef debug(filename, port_num, debug_id, debug_options, run_as,\n          _runners=RUNNERS, _extra=None, *args, **kwargs):\n    # TODO: docstring\n    if _extra is None:\n        _extra = sys.argv[1:]\n    address = (LOCALHOST, port_num)\n    try:\n        run = _runners[run_as]\n    except KeyError:\n        # TODO: fail?\n        run = _runners[None]\n    if _extra:\n        args = _extra + list(args)\n    kwargs.setdefault('singlesession', True)\n    run(address, filename, *args, **kwargs)\n\n\ndef run(filename, port_num, run_as,\n        *args, **kwargs):\n    address = (LOCALHOST, port_num)\n    run_main(address, filename, run_as, *args, **kwargs)\n", "path": "src/ptvsd/debugger.py"}]}