prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Log level `DEPRECATION` is documented but not working
  ## Description of the issue
  
  Log level `DEPRECATION` is documented but not working.
  
  ### Context information (for bug reports)
  
  * Output of `pyinstaller --version`: ```5.7.0```
  * Version of Python: 3.10.6
  * Platform: Ubuntu 22.04
  * How you installed Python: apt
  * Did you also try this on another platform? Does it work there? yes, same thing
  * try the latest development version, using the following command: yes, same thing
  
  ### A minimal example program which shows the error
  
  ```
  $ pyinstaller --help | grep -U1 DEPREC
    --log-level LEVEL     Amount of detail in build-time console messages. LEVEL
                          may be one of TRACE, DEBUG, INFO, WARN, DEPRECATION,
                          ERROR, CRITICAL (default: INFO). Also settable via and
  $ pyinstaller --log-level DEPRECATION .
  [...]
  pyinstaller: error: Unknown log level `DEPRECATION`
  ```
  
  
  </issue>
  <code>
  [start of PyInstaller/log.py]
  1 #-----------------------------------------------------------------------------
  2 # Copyright (c) 2013-2023, PyInstaller Development Team.
  3 #
  4 # Distributed under the terms of the GNU General Public License (version 2
  5 # or later) with exception for distributing the bootloader.
  6 #
  7 # The full license is in the file COPYING.txt, distributed with this software.
  8 #
  9 # SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)
  10 #-----------------------------------------------------------------------------
  11 """
  12 Logging module for PyInstaller.
  13 """
  14 
  15 __all__ = ['getLogger', 'INFO', 'WARN', 'DEBUG', 'TRACE', 'ERROR', 'FATAL', 'DEPRECATION']
  16 
  17 import os
  18 import logging
  19 from logging import DEBUG, ERROR, FATAL, INFO, WARN, getLogger
  20 
  21 TRACE = logging.TRACE = DEBUG - 5
  22 logging.addLevelName(TRACE, 'TRACE')
  23 DEPRECATION = WARN + 5
  24 logging.addLevelName(DEPRECATION, 'DEPRECATION')
  25 LEVELS = ('TRACE', 'DEBUG', 'INFO', 'WARN', 'DEPRECATION', 'ERROR', 'CRITICAL')
  26 
  27 FORMAT = '%(relativeCreated)d %(levelname)s: %(message)s'
  28 _env_level = os.environ.get("PYI_LOG_LEVEL", "INFO")
  29 try:
  30     level = getattr(logging, _env_level.upper())
  31 except AttributeError:
  32     raise SystemExit(f"Invalid PYI_LOG_LEVEL value '{_env_level}'. Should be one of {LEVELS}.")
  33 logging.basicConfig(format=FORMAT, level=level)
  34 logger = getLogger('PyInstaller')
  35 
  36 
  37 def __add_options(parser):
  38     parser.add_argument(
  39         '--log-level',
  40         choices=LEVELS,
  41         metavar="LEVEL",
  42         dest='loglevel',
  43         help='Amount of detail in build-time console messages. LEVEL may be one of %s (default: INFO). '
  44         'Also settable via and overrides the PYI_LOG_LEVEL environment variable.' % ', '.join(LEVELS),
  45     )
  46 
  47 
  48 def __process_options(parser, opts):
  49     if opts.loglevel:
  50         try:
  51             level = opts.loglevel.upper()
  52             _level = getattr(logging, level)
  53         except AttributeError:
  54             parser.error('Unknown log level `%s`' % opts.loglevel)
  55         logger.setLevel(_level)
  56         os.environ["PYI_LOG_LEVEL"] = level
  57
  [end of PyInstaller/log.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/PyInstaller/log.py b/PyInstaller/log.py
  --- a/PyInstaller/log.py
  +++ b/PyInstaller/log.py
  @@ -18,18 +18,26 @@
   import logging
   from logging import DEBUG, ERROR, FATAL, INFO, WARN, getLogger
   
  -TRACE = logging.TRACE = DEBUG - 5
  +TRACE = DEBUG - 5
   logging.addLevelName(TRACE, 'TRACE')
   DEPRECATION = WARN + 5
   logging.addLevelName(DEPRECATION, 'DEPRECATION')
  -LEVELS = ('TRACE', 'DEBUG', 'INFO', 'WARN', 'DEPRECATION', 'ERROR', 'CRITICAL')
  +LEVELS = {
  +    'TRACE': TRACE,
  +    'DEBUG': DEBUG,
  +    'INFO': INFO,
  +    'WARN': WARN,
  +    'DEPRECATION': DEPRECATION,
  +    'ERROR': ERROR,
  +    'FATAL': FATAL,
  +}
   
   FORMAT = '%(relativeCreated)d %(levelname)s: %(message)s'
   _env_level = os.environ.get("PYI_LOG_LEVEL", "INFO")
   try:
  -    level = getattr(logging, _env_level.upper())
  -except AttributeError:
  -    raise SystemExit(f"Invalid PYI_LOG_LEVEL value '{_env_level}'. Should be one of {LEVELS}.")
  +    level = LEVELS[_env_level.upper()]
  +except KeyError:
  +    raise SystemExit(f"Invalid PYI_LOG_LEVEL value '{_env_level}'. Should be one of {list(LEVELS)}.")
   logging.basicConfig(format=FORMAT, level=level)
   logger = getLogger('PyInstaller')
   
  @@ -49,8 +57,8 @@
       if opts.loglevel:
           try:
               level = opts.loglevel.upper()
  -            _level = getattr(logging, level)
  -        except AttributeError:
  +            _level = LEVELS[level]
  +        except KeyError:
               parser.error('Unknown log level `%s`' % opts.loglevel)
           logger.setLevel(_level)
           os.environ["PYI_LOG_LEVEL"] = level
  
verification_info: {"golden_diff": "diff --git a/PyInstaller/log.py b/PyInstaller/log.py\n--- a/PyInstaller/log.py\n+++ b/PyInstaller/log.py\n@@ -18,18 +18,26 @@\n import logging\n from logging import DEBUG, ERROR, FATAL, INFO, WARN, getLogger\n \n-TRACE = logging.TRACE = DEBUG - 5\n+TRACE = DEBUG - 5\n logging.addLevelName(TRACE, 'TRACE')\n DEPRECATION = WARN + 5\n logging.addLevelName(DEPRECATION, 'DEPRECATION')\n-LEVELS = ('TRACE', 'DEBUG', 'INFO', 'WARN', 'DEPRECATION', 'ERROR', 'CRITICAL')\n+LEVELS = {\n+    'TRACE': TRACE,\n+    'DEBUG': DEBUG,\n+    'INFO': INFO,\n+    'WARN': WARN,\n+    'DEPRECATION': DEPRECATION,\n+    'ERROR': ERROR,\n+    'FATAL': FATAL,\n+}\n \n FORMAT = '%(relativeCreated)d %(levelname)s: %(message)s'\n _env_level = os.environ.get(\"PYI_LOG_LEVEL\", \"INFO\")\n try:\n-    level = getattr(logging, _env_level.upper())\n-except AttributeError:\n-    raise SystemExit(f\"Invalid PYI_LOG_LEVEL value '{_env_level}'. Should be one of {LEVELS}.\")\n+    level = LEVELS[_env_level.upper()]\n+except KeyError:\n+    raise SystemExit(f\"Invalid PYI_LOG_LEVEL value '{_env_level}'. Should be one of {list(LEVELS)}.\")\n logging.basicConfig(format=FORMAT, level=level)\n logger = getLogger('PyInstaller')\n \n@@ -49,8 +57,8 @@\n     if opts.loglevel:\n         try:\n             level = opts.loglevel.upper()\n-            _level = getattr(logging, level)\n-        except AttributeError:\n+            _level = LEVELS[level]\n+        except KeyError:\n             parser.error('Unknown log level `%s`' % opts.loglevel)\n         logger.setLevel(_level)\n         os.environ[\"PYI_LOG_LEVEL\"] = level\n", "issue": "Log level `DEPRECATION` is documented but not working\n## Description of the issue\r\n\r\nLog level `DEPRECATION` is documented but not working.\r\n\r\n### Context information (for bug reports)\r\n\r\n* Output of `pyinstaller --version`: ```5.7.0```\r\n* Version of Python: 3.10.6\r\n* Platform: Ubuntu 22.04\r\n* How you installed Python: apt\r\n* Did you also try this on another platform? Does it work there? yes, same thing\r\n* try the latest development version, using the following command: yes, same thing\r\n\r\n### A minimal example program which shows the error\r\n\r\n```\r\n$ pyinstaller --help | grep -U1 DEPREC\r\n  --log-level LEVEL     Amount of detail in build-time console messages. LEVEL\r\n                        may be one of TRACE, DEBUG, INFO, WARN, DEPRECATION,\r\n                        ERROR, CRITICAL (default: INFO). Also settable via and\r\n$ pyinstaller --log-level DEPRECATION .\r\n[...]\r\npyinstaller: error: Unknown log level `DEPRECATION`\r\n```\r\n\n", "before_files": [{"content": "#-----------------------------------------------------------------------------\n# Copyright (c) 2013-2023, PyInstaller Development Team.\n#\n# Distributed under the terms of the GNU General Public License (version 2\n# or later) with exception for distributing the bootloader.\n#\n# The full license is in the file COPYING.txt, distributed with this software.\n#\n# SPDX-License-Identifier: (GPL-2.0-or-later WITH Bootloader-exception)\n#-----------------------------------------------------------------------------\n\"\"\"\nLogging module for PyInstaller.\n\"\"\"\n\n__all__ = ['getLogger', 'INFO', 'WARN', 'DEBUG', 'TRACE', 'ERROR', 'FATAL', 'DEPRECATION']\n\nimport os\nimport logging\nfrom logging import DEBUG, ERROR, FATAL, INFO, WARN, getLogger\n\nTRACE = logging.TRACE = DEBUG - 5\nlogging.addLevelName(TRACE, 'TRACE')\nDEPRECATION = WARN + 5\nlogging.addLevelName(DEPRECATION, 'DEPRECATION')\nLEVELS = ('TRACE', 'DEBUG', 'INFO', 'WARN', 'DEPRECATION', 'ERROR', 'CRITICAL')\n\nFORMAT = '%(relativeCreated)d %(levelname)s: %(message)s'\n_env_level = os.environ.get(\"PYI_LOG_LEVEL\", \"INFO\")\ntry:\n    level = getattr(logging, _env_level.upper())\nexcept AttributeError:\n    raise SystemExit(f\"Invalid PYI_LOG_LEVEL value '{_env_level}'. Should be one of {LEVELS}.\")\nlogging.basicConfig(format=FORMAT, level=level)\nlogger = getLogger('PyInstaller')\n\n\ndef __add_options(parser):\n    parser.add_argument(\n        '--log-level',\n        choices=LEVELS,\n        metavar=\"LEVEL\",\n        dest='loglevel',\n        help='Amount of detail in build-time console messages. LEVEL may be one of %s (default: INFO). '\n        'Also settable via and overrides the PYI_LOG_LEVEL environment variable.' % ', '.join(LEVELS),\n    )\n\n\ndef __process_options(parser, opts):\n    if opts.loglevel:\n        try:\n            level = opts.loglevel.upper()\n            _level = getattr(logging, level)\n        except AttributeError:\n            parser.error('Unknown log level `%s`' % opts.loglevel)\n        logger.setLevel(_level)\n        os.environ[\"PYI_LOG_LEVEL\"] = level\n", "path": "PyInstaller/log.py"}]}