Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change logging formats and move argument parsing functionality #282

Merged
merged 24 commits into from
Nov 23, 2024

Conversation

R1kaB3rN
Copy link
Member

@R1kaB3rN R1kaB3rN commented Nov 23, 2024

Key changes:

  • Moves umu.umu_run.parse_args to __main__.py.
  • Renames umu.umu_run.main to umu.umu_run.umu_run. There will be only be one main function, which is in __main__.py.
  • Removes the ANSI color code for bolded text from log messages. Color will still be applied, but only to the level section of the logger like Gamescope.
  • Removes warning as a supported value in UMU_LOG and soft deprecates debug in favor of simply 1. UMU_LOG=1 will be the new way to enable logging. Setting UMU_LOG=debug will still be valid and kept for compatibility until the next major version.
  • Adds the line number when debugging is configured.

As a result, log files should be less tedious to read through for user uploaded files or when reading through a pager utility like less. The module's functionality is a bit more organized as well. Additionally, due to moving the argument parsing functionality, running this CLI will no longer be possible within the source directory through umu_run.py. Therefore, for usage, either execute __main__.py, build the zipapp, Flatpak, distribution package, or create a systemd-sysext image. See https://www.freedesktop.org/software/systemd/man/latest/systemd-sysext.html.

- Debug logging will be enabled via UMU_LOG=1 instead of 3 different values.
- Causes environment variables to be printed for CLI options like -h or -v
- This lock file used to be created within top level of our runtime directory, and the launcher had been deleting each launch up until now as it made manual testing a bit easier. However, now, this shouldn't be needed anymore as the lock file is now stored within the 'var' directory
- It's not available in Python 3.10. May be refactored at a later time as we're targetting latest stable Debian for minimum versions of distribution packages, including Python. For now just use a simple class.
@R1kaB3rN R1kaB3rN marked this pull request as ready for review November 23, 2024 04:16
@R1kaB3rN R1kaB3rN merged commit f6a6af3 into Open-Wine-Components:main Nov 23, 2024
12 checks passed
@R1kaB3rN R1kaB3rN deleted the refactor-arg-parsing branch November 23, 2024 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant