prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [FEATURE]Do not overwrite python logging configuration
  ## 🚨🚨 Feature Request
  
  Be able to use both `logging` and `hub` in the same python script
  
  ### Current behavior
  
  I found the following code has undesired behavior: when adding the line `import hub`, the logging configuration will be overwritten.
  
  ```python
  import logging
  import hub     # this will overwrite the logging config
  
  logging.basicConfig(filename = "sample.log", level = logging.DEBUG,
                      format = '%(asctime)s: %(filename)s: %(levelname)s: %(message)s')
  
  logger = logging.getLogger(__name__)
  
  logger.debug("this is a debug message")
  logger.info("this is an info message")
  logger.warning("this is a warning message")
  logger.error("this is an error message")
  
  ```
  
  
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `hub/client/log.py`
  Content:
  ```
  1 """
  2 License:
  3 This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  4 If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
  5 """
  6 
  7 import logging
  8 import sys
  9 
  10 logger = logging.getLogger("hub")
  11 
  12 
  13 def configure_logger(debug=0):
  14     log_level = logging.DEBUG if debug == 1 else logging.INFO
  15     logging.basicConfig(format="%(message)s", level=log_level, stream=sys.stdout)
  16 
  17 
  18 configure_logger(0)
  19
  ```
  --- 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/hub/client/log.py b/hub/client/log.py
  --- a/hub/client/log.py
  +++ b/hub/client/log.py
  @@ -12,7 +12,17 @@
   
   def configure_logger(debug=0):
       log_level = logging.DEBUG if debug == 1 else logging.INFO
  -    logging.basicConfig(format="%(message)s", level=log_level, stream=sys.stdout)
  +    logger.setLevel(log_level)
  +
  +    stream_handler = logging.StreamHandler(stream=sys.stdout)
  +    stream_handler.setLevel(log_level)
  +
  +    formatter = logging.Formatter("%(message)s")
  +
  +    stream_handler.setFormatter(formatter)
  +
  +    logger.addHandler(stream_handler)
  +    logger.propagate = False
   
   
   configure_logger(0)
  
verification_info: {"golden_diff": "diff --git a/hub/client/log.py b/hub/client/log.py\n--- a/hub/client/log.py\n+++ b/hub/client/log.py\n@@ -12,7 +12,17 @@\n \n def configure_logger(debug=0):\n     log_level = logging.DEBUG if debug == 1 else logging.INFO\n-    logging.basicConfig(format=\"%(message)s\", level=log_level, stream=sys.stdout)\n+    logger.setLevel(log_level)\n+\n+    stream_handler = logging.StreamHandler(stream=sys.stdout)\n+    stream_handler.setLevel(log_level)\n+\n+    formatter = logging.Formatter(\"%(message)s\")\n+\n+    stream_handler.setFormatter(formatter)\n+\n+    logger.addHandler(stream_handler)\n+    logger.propagate = False\n \n \n configure_logger(0)\n", "issue": "[FEATURE]Do not overwrite python logging configuration\n## \ud83d\udea8\ud83d\udea8 Feature Request\r\n\r\nBe able to use both `logging` and `hub` in the same python script\r\n\r\n### Current behavior\r\n\r\nI found the following code has undesired behavior: when adding the line `import hub`, the logging configuration will be overwritten.\r\n\r\n```python\r\nimport logging\r\nimport hub     # this will overwrite the logging config\r\n\r\nlogging.basicConfig(filename = \"sample.log\", level = logging.DEBUG,\r\n                    format = '%(asctime)s: %(filename)s: %(levelname)s: %(message)s')\r\n\r\nlogger = logging.getLogger(__name__)\r\n\r\nlogger.debug(\"this is a debug message\")\r\nlogger.info(\"this is an info message\")\r\nlogger.warning(\"this is a warning message\")\r\nlogger.error(\"this is an error message\")\r\n\r\n```\r\n\r\n\r\n\r\n\n", "before_files": [{"content": "\"\"\"\nLicense:\nThis Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.\nIf a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\"\"\"\n\nimport logging\nimport sys\n\nlogger = logging.getLogger(\"hub\")\n\n\ndef configure_logger(debug=0):\n    log_level = logging.DEBUG if debug == 1 else logging.INFO\n    logging.basicConfig(format=\"%(message)s\", level=log_level, stream=sys.stdout)\n\n\nconfigure_logger(0)\n", "path": "hub/client/log.py"}], "after_files": [{"content": "\"\"\"\nLicense:\nThis Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.\nIf a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.\n\"\"\"\n\nimport logging\nimport sys\n\nlogger = logging.getLogger(\"hub\")\n\n\ndef configure_logger(debug=0):\n    log_level = logging.DEBUG if debug == 1 else logging.INFO\n    logger.setLevel(log_level)\n\n    stream_handler = logging.StreamHandler(stream=sys.stdout)\n    stream_handler.setLevel(log_level)\n\n    formatter = logging.Formatter(\"%(message)s\")\n\n    stream_handler.setFormatter(formatter)\n\n    logger.addHandler(stream_handler)\n    logger.propagate = False\n\n\nconfigure_logger(0)\n", "path": "hub/client/log.py"}]}