We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
using Qtile.cmd_{info, debug} doesn't switch logging level
It seems that critical, warning, and error do all work, though.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `libqtile/log_utils.py`
Content:
```
1 import logging
2 import os
3 import sys
4 from logging import getLogger, StreamHandler
5 
6 
7 class ColorFormatter(logging.Formatter):
8     """Logging formatter adding console colors to the output.
9     """
10     black, red, green, yellow, blue, magenta, cyan, white = range(8)
11     colors = {
12         'WARNING': yellow,
13         'INFO': green,
14         'DEBUG': blue,
15         'CRITICAL': yellow,
16         'ERROR': red,
17         'RED': red,
18         'GREEN': green,
19         'YELLOW': yellow,
20         'BLUE': blue,
21         'MAGENTA': magenta,
22         'CYAN': cyan,
23         'WHITE': white}
24     reset_seq = '\033[0m'
25     color_seq = '\033[%dm'
26     bold_seq = '\033[1m'
27 
28     def format(self, record):
29         """Format the record with colors."""
30         color = self.color_seq % (30 + self.colors[record.levelname])
31         message = logging.Formatter.format(self, record)
32         message = message.replace('$RESET', self.reset_seq)\
33             .replace('$BOLD', self.bold_seq)\
34             .replace('$COLOR', color)
35         for color, value in self.colors.items():
36             message = message.replace(
37                 '$' + color, self.color_seq % (value + 30))\
38                 .replace('$BG' + color, self.color_seq % (value + 40))\
39                 .replace('$BG-' + color, self.color_seq % (value + 40))
40         return message + self.reset_seq
41 
42 
43 def init_log(log_level=logging.WARNING, logger='qtile'):
44     handler = logging.FileHandler(
45         os.path.expanduser('~/.%s.log' % logger))
46     handler.setLevel(logging.WARNING)
47     handler.setFormatter(
48         logging.Formatter(
49             "%(asctime)s %(levelname)s %(funcName)s:%(lineno)d %(message)s"))
50     log = getLogger(logger)
51     log.setLevel(log_level)
52     log.addHandler(handler)
53     log.warning('Starting %s' % logger.title())
54     handler = StreamHandler(sys.stderr)
55     handler.setFormatter(
56         ColorFormatter(
57             '$RESET$COLOR%(asctime)s $BOLD$COLOR%(name)s'
58             ' %(funcName)s:%(lineno)d $RESET %(message)s'))
59     log.addHandler(handler)
60     return log
61
```
--- 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/libqtile/log_utils.py b/libqtile/log_utils.py
--- a/libqtile/log_utils.py
+++ b/libqtile/log_utils.py
@@ -43,7 +43,6 @@
 def init_log(log_level=logging.WARNING, logger='qtile'):
     handler = logging.FileHandler(
         os.path.expanduser('~/.%s.log' % logger))
-    handler.setLevel(logging.WARNING)
     handler.setFormatter(
         logging.Formatter(
             "%(asctime)s %(levelname)s %(funcName)s:%(lineno)d %(message)s"))

{"golden_diff": "diff --git a/libqtile/log_utils.py b/libqtile/log_utils.py\n--- a/libqtile/log_utils.py\n+++ b/libqtile/log_utils.py\n@@ -43,7 +43,6 @@\n def init_log(log_level=logging.WARNING, logger='qtile'):\n     handler = logging.FileHandler(\n         os.path.expanduser('~/.%s.log' % logger))\n-    handler.setLevel(logging.WARNING)\n     handler.setFormatter(\n         logging.Formatter(\n             \"%(asctime)s %(levelname)s %(funcName)s:%(lineno)d %(message)s\"))\n", "issue": "using Qtile.cmd_{info, debug} doesn't switch logging level\nIt seems that critical, warning, and error do all work, though.\n\n", "before_files": [{"content": "import logging\nimport os\nimport sys\nfrom logging import getLogger, StreamHandler\n\n\nclass ColorFormatter(logging.Formatter):\n    \"\"\"Logging formatter adding console colors to the output.\n    \"\"\"\n    black, red, green, yellow, blue, magenta, cyan, white = range(8)\n    colors = {\n        'WARNING': yellow,\n        'INFO': green,\n        'DEBUG': blue,\n        'CRITICAL': yellow,\n        'ERROR': red,\n        'RED': red,\n        'GREEN': green,\n        'YELLOW': yellow,\n        'BLUE': blue,\n        'MAGENTA': magenta,\n        'CYAN': cyan,\n        'WHITE': white}\n    reset_seq = '\\033[0m'\n    color_seq = '\\033[%dm'\n    bold_seq = '\\033[1m'\n\n    def format(self, record):\n        \"\"\"Format the record with colors.\"\"\"\n        color = self.color_seq % (30 + self.colors[record.levelname])\n        message = logging.Formatter.format(self, record)\n        message = message.replace('$RESET', self.reset_seq)\\\n            .replace('$BOLD', self.bold_seq)\\\n            .replace('$COLOR', color)\n        for color, value in self.colors.items():\n            message = message.replace(\n                '$' + color, self.color_seq % (value + 30))\\\n                .replace('$BG' + color, self.color_seq % (value + 40))\\\n                .replace('$BG-' + color, self.color_seq % (value + 40))\n        return message + self.reset_seq\n\n\ndef init_log(log_level=logging.WARNING, logger='qtile'):\n    handler = logging.FileHandler(\n        os.path.expanduser('~/.%s.log' % logger))\n    handler.setLevel(logging.WARNING)\n    handler.setFormatter(\n        logging.Formatter(\n            \"%(asctime)s %(levelname)s %(funcName)s:%(lineno)d %(message)s\"))\n    log = getLogger(logger)\n    log.setLevel(log_level)\n    log.addHandler(handler)\n    log.warning('Starting %s' % logger.title())\n    handler = StreamHandler(sys.stderr)\n    handler.setFormatter(\n        ColorFormatter(\n            '$RESET$COLOR%(asctime)s $BOLD$COLOR%(name)s'\n            ' %(funcName)s:%(lineno)d $RESET %(message)s'))\n    log.addHandler(handler)\n    return log\n", "path": "libqtile/log_utils.py"}], "after_files": [{"content": "import logging\nimport os\nimport sys\nfrom logging import getLogger, StreamHandler\n\n\nclass ColorFormatter(logging.Formatter):\n    \"\"\"Logging formatter adding console colors to the output.\n    \"\"\"\n    black, red, green, yellow, blue, magenta, cyan, white = range(8)\n    colors = {\n        'WARNING': yellow,\n        'INFO': green,\n        'DEBUG': blue,\n        'CRITICAL': yellow,\n        'ERROR': red,\n        'RED': red,\n        'GREEN': green,\n        'YELLOW': yellow,\n        'BLUE': blue,\n        'MAGENTA': magenta,\n        'CYAN': cyan,\n        'WHITE': white}\n    reset_seq = '\\033[0m'\n    color_seq = '\\033[%dm'\n    bold_seq = '\\033[1m'\n\n    def format(self, record):\n        \"\"\"Format the record with colors.\"\"\"\n        color = self.color_seq % (30 + self.colors[record.levelname])\n        message = logging.Formatter.format(self, record)\n        message = message.replace('$RESET', self.reset_seq)\\\n            .replace('$BOLD', self.bold_seq)\\\n            .replace('$COLOR', color)\n        for color, value in self.colors.items():\n            message = message.replace(\n                '$' + color, self.color_seq % (value + 30))\\\n                .replace('$BG' + color, self.color_seq % (value + 40))\\\n                .replace('$BG-' + color, self.color_seq % (value + 40))\n        return message + self.reset_seq\n\n\ndef init_log(log_level=logging.WARNING, logger='qtile'):\n    handler = logging.FileHandler(\n        os.path.expanduser('~/.%s.log' % logger))\n    handler.setFormatter(\n        logging.Formatter(\n            \"%(asctime)s %(levelname)s %(funcName)s:%(lineno)d %(message)s\"))\n    log = getLogger(logger)\n    log.setLevel(log_level)\n    log.addHandler(handler)\n    log.warning('Starting %s' % logger.title())\n    handler = StreamHandler(sys.stderr)\n    handler.setFormatter(\n        ColorFormatter(\n            '$RESET$COLOR%(asctime)s $BOLD$COLOR%(name)s'\n            ' %(funcName)s:%(lineno)d $RESET %(message)s'))\n    log.addHandler(handler)\n    return log\n", "path": "libqtile/log_utils.py"}]}