prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  using Qtile.cmd_{info, debug} doesn't switch logging level
  It seems that critical, warning, and error do all work, though.
  
  
  </issue>
  <code>
  [start of libqtile/log_utils.py]
  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 of libqtile/log_utils.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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"))
  
verification_info: {"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"}]}