We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Missing sys module import in logger.py
Logger module is missing an import statement for 'sys'

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `turbinia/config/logger.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # Copyright 2017 Google Inc.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 """Sets up logging."""
16 
17 from __future__ import unicode_literals
18 import logging
19 
20 import warnings
21 import logging.handlers
22 import os
23 
24 from turbinia import config
25 from turbinia import TurbiniaException
26 
27 # Environment variable to look for node name in
28 ENVNODENAME = 'NODE_NAME'
29 
30 
31 def setup(need_file_handler=True, need_stream_handler=True, log_file_path=None):
32   """Set up logging parameters.
33 
34   This will also set the root logger, which is the default logger when a named
35   logger is not specified.  We currently use 'turbinia' as the named logger,
36   however some external modules that are called by Turbinia can use the root
37   logger, so we want to be able to optionally configure that as well.
38   """
39   # Remove known warning about credentials
40   warnings.filterwarnings(
41       'ignore', 'Your application has authenticated using end user credentials')
42 
43   logger = logging.getLogger('turbinia')
44   # Eliminate double logging from root logger
45   logger.propagate = False
46 
47   # We only need a handler if one of that type doesn't exist already
48   if logger.handlers:
49     for handler in logger.handlers:
50       # Want to do strict type-checking here because is instance will include
51       # subclasses and so won't distinguish between StreamHandlers and
52       # FileHandlers.
53       # pylint: disable=unidiomatic-typecheck
54       if type(handler) == logging.FileHandler:
55         need_file_handler = False
56 
57       # pylint: disable=unidiomatic-typecheck
58       if type(handler) == logging.StreamHandler:
59         need_stream_handler = False
60 
61   if need_file_handler:
62     try:
63       config.LoadConfig()
64     except TurbiniaException as exception:
65       print(
66           'Could not load config file ({0!s}).\n{1:s}'.format(
67               exception, config.CONFIG_MSG))
68       sys.exit(1)
69 
70     # Check if a user specified log path was provided else create default path
71     if not log_file_path:
72       log_name = os.uname().nodename
73       # Check if NODE_NAME available for GKE setups
74       if ENVNODENAME in os.environ:
75         log_name = log_name + '.{0!s}'.format(os.environ[ENVNODENAME])
76       log_file_path = os.path.join(config.LOG_DIR, log_name) + '.log'
77 
78     file_handler = logging.FileHandler(log_file_path)
79     formatter = logging.Formatter('%(asctime)s:%(levelname)s:%(message)s')
80     file_handler.setFormatter(formatter)
81     file_handler.setLevel(logging.DEBUG)
82     logger.addHandler(file_handler)
83 
84   console_handler = logging.StreamHandler()
85   formatter = logging.Formatter(
86       '%(asctime)s [%(levelname)s] %(message)s', "%Y-%m-%d %H:%M:%S")
87   console_handler.setFormatter(formatter)
88   if need_stream_handler:
89     logger.addHandler(console_handler)
90 
91   # Configure the root logger to use exactly our handlers because other modules
92   # like PSQ use this, and we want to see log messages from it when executing
93   # from CLI.
94   root_log = logging.getLogger()
95   for handler in root_log.handlers:
96     root_log.removeHandler(handler)
97   root_log.addHandler(console_handler)
98   if need_file_handler:
99     root_log.addHandler(file_handler)
100 
101   # Set filelock logging to ERROR due to log spam
102   logging.getLogger("filelock").setLevel(logging.ERROR)
103
```
--- 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()

```

diff --git a/turbinia/config/logger.py b/turbinia/config/logger.py
--- a/turbinia/config/logger.py
+++ b/turbinia/config/logger.py
@@ -20,6 +20,7 @@
 import warnings
 import logging.handlers
 import os
+import sys
 
 from turbinia import config
 from turbinia import TurbiniaException

{"golden_diff": "diff --git a/turbinia/config/logger.py b/turbinia/config/logger.py\n--- a/turbinia/config/logger.py\n+++ b/turbinia/config/logger.py\n@@ -20,6 +20,7 @@\n import warnings\n import logging.handlers\n import os\n+import sys\n \n from turbinia import config\n from turbinia import TurbiniaException\n", "issue": "Missing sys module import in logger.py\nLogger module is missing an import statement for 'sys'\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Sets up logging.\"\"\"\n\nfrom __future__ import unicode_literals\nimport logging\n\nimport warnings\nimport logging.handlers\nimport os\n\nfrom turbinia import config\nfrom turbinia import TurbiniaException\n\n# Environment variable to look for node name in\nENVNODENAME = 'NODE_NAME'\n\n\ndef setup(need_file_handler=True, need_stream_handler=True, log_file_path=None):\n  \"\"\"Set up logging parameters.\n\n  This will also set the root logger, which is the default logger when a named\n  logger is not specified.  We currently use 'turbinia' as the named logger,\n  however some external modules that are called by Turbinia can use the root\n  logger, so we want to be able to optionally configure that as well.\n  \"\"\"\n  # Remove known warning about credentials\n  warnings.filterwarnings(\n      'ignore', 'Your application has authenticated using end user credentials')\n\n  logger = logging.getLogger('turbinia')\n  # Eliminate double logging from root logger\n  logger.propagate = False\n\n  # We only need a handler if one of that type doesn't exist already\n  if logger.handlers:\n    for handler in logger.handlers:\n      # Want to do strict type-checking here because is instance will include\n      # subclasses and so won't distinguish between StreamHandlers and\n      # FileHandlers.\n      # pylint: disable=unidiomatic-typecheck\n      if type(handler) == logging.FileHandler:\n        need_file_handler = False\n\n      # pylint: disable=unidiomatic-typecheck\n      if type(handler) == logging.StreamHandler:\n        need_stream_handler = False\n\n  if need_file_handler:\n    try:\n      config.LoadConfig()\n    except TurbiniaException as exception:\n      print(\n          'Could not load config file ({0!s}).\\n{1:s}'.format(\n              exception, config.CONFIG_MSG))\n      sys.exit(1)\n\n    # Check if a user specified log path was provided else create default path\n    if not log_file_path:\n      log_name = os.uname().nodename\n      # Check if NODE_NAME available for GKE setups\n      if ENVNODENAME in os.environ:\n        log_name = log_name + '.{0!s}'.format(os.environ[ENVNODENAME])\n      log_file_path = os.path.join(config.LOG_DIR, log_name) + '.log'\n\n    file_handler = logging.FileHandler(log_file_path)\n    formatter = logging.Formatter('%(asctime)s:%(levelname)s:%(message)s')\n    file_handler.setFormatter(formatter)\n    file_handler.setLevel(logging.DEBUG)\n    logger.addHandler(file_handler)\n\n  console_handler = logging.StreamHandler()\n  formatter = logging.Formatter(\n      '%(asctime)s [%(levelname)s] %(message)s', \"%Y-%m-%d %H:%M:%S\")\n  console_handler.setFormatter(formatter)\n  if need_stream_handler:\n    logger.addHandler(console_handler)\n\n  # Configure the root logger to use exactly our handlers because other modules\n  # like PSQ use this, and we want to see log messages from it when executing\n  # from CLI.\n  root_log = logging.getLogger()\n  for handler in root_log.handlers:\n    root_log.removeHandler(handler)\n  root_log.addHandler(console_handler)\n  if need_file_handler:\n    root_log.addHandler(file_handler)\n\n  # Set filelock logging to ERROR due to log spam\n  logging.getLogger(\"filelock\").setLevel(logging.ERROR)\n", "path": "turbinia/config/logger.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\"\"\"Sets up logging.\"\"\"\n\nfrom __future__ import unicode_literals\nimport logging\n\nimport warnings\nimport logging.handlers\nimport os\nimport sys\n\nfrom turbinia import config\nfrom turbinia import TurbiniaException\n\n# Environment variable to look for node name in\nENVNODENAME = 'NODE_NAME'\n\n\ndef setup(need_file_handler=True, need_stream_handler=True, log_file_path=None):\n  \"\"\"Set up logging parameters.\n\n  This will also set the root logger, which is the default logger when a named\n  logger is not specified.  We currently use 'turbinia' as the named logger,\n  however some external modules that are called by Turbinia can use the root\n  logger, so we want to be able to optionally configure that as well.\n  \"\"\"\n  # Remove known warning about credentials\n  warnings.filterwarnings(\n      'ignore', 'Your application has authenticated using end user credentials')\n\n  logger = logging.getLogger('turbinia')\n  # Eliminate double logging from root logger\n  logger.propagate = False\n\n  # We only need a handler if one of that type doesn't exist already\n  if logger.handlers:\n    for handler in logger.handlers:\n      # Want to do strict type-checking here because is instance will include\n      # subclasses and so won't distinguish between StreamHandlers and\n      # FileHandlers.\n      # pylint: disable=unidiomatic-typecheck\n      if type(handler) == logging.FileHandler:\n        need_file_handler = False\n\n      # pylint: disable=unidiomatic-typecheck\n      if type(handler) == logging.StreamHandler:\n        need_stream_handler = False\n\n  if need_file_handler:\n    try:\n      config.LoadConfig()\n    except TurbiniaException as exception:\n      print(\n          'Could not load config file ({0!s}).\\n{1:s}'.format(\n              exception, config.CONFIG_MSG))\n      sys.exit(1)\n\n    # Check if a user specified log path was provided else create default path\n    if not log_file_path:\n      log_name = os.uname().nodename\n      # Check if NODE_NAME available for GKE setups\n      if ENVNODENAME in os.environ:\n        log_name = log_name + '.{0!s}'.format(os.environ[ENVNODENAME])\n      log_file_path = os.path.join(config.LOG_DIR, log_name) + '.log'\n\n    file_handler = logging.FileHandler(log_file_path)\n    formatter = logging.Formatter('%(asctime)s:%(levelname)s:%(message)s')\n    file_handler.setFormatter(formatter)\n    file_handler.setLevel(logging.DEBUG)\n    logger.addHandler(file_handler)\n\n  console_handler = logging.StreamHandler()\n  formatter = logging.Formatter(\n      '%(asctime)s [%(levelname)s] %(message)s', \"%Y-%m-%d %H:%M:%S\")\n  console_handler.setFormatter(formatter)\n  if need_stream_handler:\n    logger.addHandler(console_handler)\n\n  # Configure the root logger to use exactly our handlers because other modules\n  # like PSQ use this, and we want to see log messages from it when executing\n  # from CLI.\n  root_log = logging.getLogger()\n  for handler in root_log.handlers:\n    root_log.removeHandler(handler)\n  root_log.addHandler(console_handler)\n  if need_file_handler:\n    root_log.addHandler(file_handler)\n\n  # Set filelock logging to ERROR due to log spam\n  logging.getLogger(\"filelock\").setLevel(logging.ERROR)\n", "path": "turbinia/config/logger.py"}]}