prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN 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`).
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/ptvsd/debugger.py`
  Content:
  ```
  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 FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
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"}], "after_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\nimport ptvsd.log\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\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    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\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", "path": "src/ptvsd/debugger.py"}]}