prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  `set_qiskit_logger()` is hard to use
  <!-- ⚠️ If you do not respect this template, your issue will be closed -->
  <!-- ⚠️ Make sure to browse the opened and closed issues to confirm this idea does not exist. -->
  
  ### What is the expected enhancement?
  A utility method `[set_qiskit_logger()]`(https://github.com/Qiskit/qiskit-terra/blob/cac7c6a2631d76ef3e811a5c943a2b9101fed240/qiskit/_logging.py#L48) exists to log qiskit-terra's execution flow.
  
  It has room for improvement, namely:
  - It turns on logging everywhere, thus generating a lot of noise. One should be able to specify a certain file to or module to log.
  - One cannot customize the LOG_LEVEL.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `qiskit/tools/logging.py`
  Content:
  ```
  1 # -*- coding: utf-8 -*-
  2 
  3 # This code is part of Qiskit.
  4 #
  5 # (C) Copyright IBM 2017.
  6 #
  7 # This code is licensed under the Apache License, Version 2.0. You may
  8 # obtain a copy of this license in the LICENSE.txt file in the root directory
  9 # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
  10 #
  11 # Any modifications or derivative works of this code must retain this
  12 # copyright notice, and modified files need to carry a notice indicating
  13 # that they have been altered from the originals.
  14 
  15 """Utilities for logging."""
  16 
  17 import logging
  18 from logging.config import dictConfig
  19 
  20 
  21 class SimpleInfoFormatter(logging.Formatter):
  22     """Custom Formatter that uses a simple format for INFO."""
  23     _style_info = logging._STYLES['%'][0]('%(message)s')
  24 
  25     def formatMessage(self, record):
  26         if record.levelno == logging.INFO:
  27             return self._style_info.format(record)
  28         return logging.Formatter.formatMessage(self, record)
  29 
  30 
  31 QISKIT_LOGGING_CONFIG = {
  32     'version': 1,
  33     'disable_existing_loggers': False,
  34     'formatters': {
  35         'f': {
  36             '()': SimpleInfoFormatter,
  37             'format': '%(asctime)s:%(name)s:%(levelname)s: %(message)s'
  38         },
  39     },
  40     'handlers': {
  41         'h': {
  42             'class': 'logging.StreamHandler',
  43             'formatter': 'f'
  44         }
  45     },
  46     'loggers': {
  47         'qiskit': {
  48             'handlers': ['h'],
  49             'level': logging.INFO,
  50         },
  51     }
  52 }
  53 
  54 
  55 def set_qiskit_logger():
  56     """Update 'qiskit' logger configuration using a SDK default one.
  57 
  58     Update the configuration of the 'qiskit' logger using the default SDK
  59     configuration provided by `QISKIT_LOGGING_CONFIG`:
  60 
  61     * console logging using a custom format for levels != INFO.
  62     * console logging with simple format for level INFO.
  63     * set logger level to INFO.
  64 
  65     Warning:
  66         This function modifies the configuration of the standard logging system
  67         for the 'qiskit.*' loggers, and might interfere with custom logger
  68         configurations.
  69     """
  70     dictConfig(QISKIT_LOGGING_CONFIG)
  71 
  72 
  73 def unset_qiskit_logger():
  74     """Remove the handlers for the 'qiskit' logger."""
  75     qiskit_logger = logging.getLogger('qiskit')
  76     for handler in qiskit_logger.handlers:
  77         qiskit_logger.removeHandler(handler)
  78
  ```
  --- 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/qiskit/tools/logging.py b/qiskit/tools/logging.py
  deleted file mode 100644
  --- a/qiskit/tools/logging.py
  +++ /dev/null
  @@ -1,77 +0,0 @@
  -# -*- coding: utf-8 -*-
  -
  -# This code is part of Qiskit.
  -#
  -# (C) Copyright IBM 2017.
  -#
  -# This code is licensed under the Apache License, Version 2.0. You may
  -# obtain a copy of this license in the LICENSE.txt file in the root directory
  -# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
  -#
  -# Any modifications or derivative works of this code must retain this
  -# copyright notice, and modified files need to carry a notice indicating
  -# that they have been altered from the originals.
  -
  -"""Utilities for logging."""
  -
  -import logging
  -from logging.config import dictConfig
  -
  -
  -class SimpleInfoFormatter(logging.Formatter):
  -    """Custom Formatter that uses a simple format for INFO."""
  -    _style_info = logging._STYLES['%'][0]('%(message)s')
  -
  -    def formatMessage(self, record):
  -        if record.levelno == logging.INFO:
  -            return self._style_info.format(record)
  -        return logging.Formatter.formatMessage(self, record)
  -
  -
  -QISKIT_LOGGING_CONFIG = {
  -    'version': 1,
  -    'disable_existing_loggers': False,
  -    'formatters': {
  -        'f': {
  -            '()': SimpleInfoFormatter,
  -            'format': '%(asctime)s:%(name)s:%(levelname)s: %(message)s'
  -        },
  -    },
  -    'handlers': {
  -        'h': {
  -            'class': 'logging.StreamHandler',
  -            'formatter': 'f'
  -        }
  -    },
  -    'loggers': {
  -        'qiskit': {
  -            'handlers': ['h'],
  -            'level': logging.INFO,
  -        },
  -    }
  -}
  -
  -
  -def set_qiskit_logger():
  -    """Update 'qiskit' logger configuration using a SDK default one.
  -
  -    Update the configuration of the 'qiskit' logger using the default SDK
  -    configuration provided by `QISKIT_LOGGING_CONFIG`:
  -
  -    * console logging using a custom format for levels != INFO.
  -    * console logging with simple format for level INFO.
  -    * set logger level to INFO.
  -
  -    Warning:
  -        This function modifies the configuration of the standard logging system
  -        for the 'qiskit.*' loggers, and might interfere with custom logger
  -        configurations.
  -    """
  -    dictConfig(QISKIT_LOGGING_CONFIG)
  -
  -
  -def unset_qiskit_logger():
  -    """Remove the handlers for the 'qiskit' logger."""
  -    qiskit_logger = logging.getLogger('qiskit')
  -    for handler in qiskit_logger.handlers:
  -        qiskit_logger.removeHandler(handler)
  
verification_info: {"golden_diff": "diff --git a/qiskit/tools/logging.py b/qiskit/tools/logging.py\ndeleted file mode 100644\n--- a/qiskit/tools/logging.py\n+++ /dev/null\n@@ -1,77 +0,0 @@\n-# -*- coding: utf-8 -*-\n-\n-# This code is part of Qiskit.\n-#\n-# (C) Copyright IBM 2017.\n-#\n-# This code is licensed under the Apache License, Version 2.0. You may\n-# obtain a copy of this license in the LICENSE.txt file in the root directory\n-# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n-#\n-# Any modifications or derivative works of this code must retain this\n-# copyright notice, and modified files need to carry a notice indicating\n-# that they have been altered from the originals.\n-\n-\"\"\"Utilities for logging.\"\"\"\n-\n-import logging\n-from logging.config import dictConfig\n-\n-\n-class SimpleInfoFormatter(logging.Formatter):\n-    \"\"\"Custom Formatter that uses a simple format for INFO.\"\"\"\n-    _style_info = logging._STYLES['%'][0]('%(message)s')\n-\n-    def formatMessage(self, record):\n-        if record.levelno == logging.INFO:\n-            return self._style_info.format(record)\n-        return logging.Formatter.formatMessage(self, record)\n-\n-\n-QISKIT_LOGGING_CONFIG = {\n-    'version': 1,\n-    'disable_existing_loggers': False,\n-    'formatters': {\n-        'f': {\n-            '()': SimpleInfoFormatter,\n-            'format': '%(asctime)s:%(name)s:%(levelname)s: %(message)s'\n-        },\n-    },\n-    'handlers': {\n-        'h': {\n-            'class': 'logging.StreamHandler',\n-            'formatter': 'f'\n-        }\n-    },\n-    'loggers': {\n-        'qiskit': {\n-            'handlers': ['h'],\n-            'level': logging.INFO,\n-        },\n-    }\n-}\n-\n-\n-def set_qiskit_logger():\n-    \"\"\"Update 'qiskit' logger configuration using a SDK default one.\n-\n-    Update the configuration of the 'qiskit' logger using the default SDK\n-    configuration provided by `QISKIT_LOGGING_CONFIG`:\n-\n-    * console logging using a custom format for levels != INFO.\n-    * console logging with simple format for level INFO.\n-    * set logger level to INFO.\n-\n-    Warning:\n-        This function modifies the configuration of the standard logging system\n-        for the 'qiskit.*' loggers, and might interfere with custom logger\n-        configurations.\n-    \"\"\"\n-    dictConfig(QISKIT_LOGGING_CONFIG)\n-\n-\n-def unset_qiskit_logger():\n-    \"\"\"Remove the handlers for the 'qiskit' logger.\"\"\"\n-    qiskit_logger = logging.getLogger('qiskit')\n-    for handler in qiskit_logger.handlers:\n-        qiskit_logger.removeHandler(handler)\n", "issue": "`set_qiskit_logger()` is hard to use\n<!-- \u26a0\ufe0f If you do not respect this template, your issue will be closed -->\r\n<!-- \u26a0\ufe0f Make sure to browse the opened and closed issues to confirm this idea does not exist. -->\r\n\r\n### What is the expected enhancement?\r\nA utility method `[set_qiskit_logger()]`(https://github.com/Qiskit/qiskit-terra/blob/cac7c6a2631d76ef3e811a5c943a2b9101fed240/qiskit/_logging.py#L48) exists to log qiskit-terra's execution flow.\r\n\r\nIt has room for improvement, namely:\r\n- It turns on logging everywhere, thus generating a lot of noise. One should be able to specify a certain file to or module to log.\r\n- One cannot customize the LOG_LEVEL.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or derivative works of this code must retain this\n# copyright notice, and modified files need to carry a notice indicating\n# that they have been altered from the originals.\n\n\"\"\"Utilities for logging.\"\"\"\n\nimport logging\nfrom logging.config import dictConfig\n\n\nclass SimpleInfoFormatter(logging.Formatter):\n    \"\"\"Custom Formatter that uses a simple format for INFO.\"\"\"\n    _style_info = logging._STYLES['%'][0]('%(message)s')\n\n    def formatMessage(self, record):\n        if record.levelno == logging.INFO:\n            return self._style_info.format(record)\n        return logging.Formatter.formatMessage(self, record)\n\n\nQISKIT_LOGGING_CONFIG = {\n    'version': 1,\n    'disable_existing_loggers': False,\n    'formatters': {\n        'f': {\n            '()': SimpleInfoFormatter,\n            'format': '%(asctime)s:%(name)s:%(levelname)s: %(message)s'\n        },\n    },\n    'handlers': {\n        'h': {\n            'class': 'logging.StreamHandler',\n            'formatter': 'f'\n        }\n    },\n    'loggers': {\n        'qiskit': {\n            'handlers': ['h'],\n            'level': logging.INFO,\n        },\n    }\n}\n\n\ndef set_qiskit_logger():\n    \"\"\"Update 'qiskit' logger configuration using a SDK default one.\n\n    Update the configuration of the 'qiskit' logger using the default SDK\n    configuration provided by `QISKIT_LOGGING_CONFIG`:\n\n    * console logging using a custom format for levels != INFO.\n    * console logging with simple format for level INFO.\n    * set logger level to INFO.\n\n    Warning:\n        This function modifies the configuration of the standard logging system\n        for the 'qiskit.*' loggers, and might interfere with custom logger\n        configurations.\n    \"\"\"\n    dictConfig(QISKIT_LOGGING_CONFIG)\n\n\ndef unset_qiskit_logger():\n    \"\"\"Remove the handlers for the 'qiskit' logger.\"\"\"\n    qiskit_logger = logging.getLogger('qiskit')\n    for handler in qiskit_logger.handlers:\n        qiskit_logger.removeHandler(handler)\n", "path": "qiskit/tools/logging.py"}], "after_files": [{"content": null, "path": "qiskit/tools/logging.py"}]}