log21
A simple logging package that helps you log colorized messages in Windows console and other operating systems.
Features
- Colors : The main reason for this package was to log text in the Windows console with the support of ANSI colors.
- Argument parsing : log21's argument parser can be used like python's argparse, but it also colorizes the output.
- Logging : A similar logger to logging. Logger but with colorized output and other options such as levelname modifications. It can also decolorize the output if you want to log into a file.
- Pretty printing : Have you ever wanted to colorize the output of the pprint module? log21's pretty printer can do that.
- Tree printing : You can pass a dict or list to
log21.tree_printfunction, and it will print it in a tree-like structure. It's also colorized XD. - ProgressBar : log21's progress bar can be used to show progress of a process in a beautiful way.
- LoggingWindow : Helps you to log messages and debug your code in a window other than the console.
- CrashReporter : log21's crash reporter can be used to report crashes in different ways. You can use it to log crashes to console or files or use it to receive crash reports of your program through email. And you can also define your own crash reporter functions and use them instead!
- Argumentify : You can use the argumentify feature to decrease the number of lines you need to write to parse command-line arguments. It's colored by the way!
- Any idea? Feel free to open an issue or submit a merge request.
Installation
Well, this is a python package so the first thing you need is python.
If you don't have python installed, please visit Python.org and install the latest version of python.
Then you can install log21 using pip module:
python -m pip install log21 -U
Or you can clone the repository and run:
pip install .
Or let the pip get it using git:
pip install git+https://gitlab.com/CodeWriter21/log21.git
Changelog
v3.12.2
Fixed two more color leaks in ColorizingHelpFormatter: the {a, b, c}
metavar reset plus a new terminating reset on _format_action_invocation
(-s, --long lines), whose switches/values color bled into the next line.
Remaining emitters audited — all terminate or are contained.
Usage Examples
See EXAMPLES.md
About
Author: CodeWriter21 (Mehrad Pooryoussof)
GitLab: CodeWriter21
Telegram Channel: @CodeWriter21
License
Donate
In order to support this project you can donate some crypto of your choice 8D
Or if you can't, give this project a star on GitLab :)
References
- ANSI Color Codes (Wikipedia): https://en.wikipedia.org/wiki/ANSI_escape_code
Metadata
Release files for log21 3.12.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| log21-3.12.2.tar.gz | 95.8 kB | Without provenance | Details for log21-3.12.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| log21-3.12.2-py3-none-any.whl | Python 3 | none | any | Details for log21-3.12.2-py3-none-any.whl |
Total release size: 199.6 kB
Release files / log21-3.12.2.tar.gz
| Download URL | log21-3.12.2.tar.gz |
|---|---|
| Size | 95.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e5cf788588c5f56d67e4935751ccf2fa99a32f9650761c29f25d963895e2dbcc
|
|
BLAKE2b-256 checksum How to use checksums |
4f274a40dba125adc379c652cc2fcca78d22a9fcc3d8211973379b47d9e4754e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / log21-3.12.2-py3-none-any.whl
| Download URL | log21-3.12.2-py3-none-any.whl |
|---|---|
| Size | 103.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9a8436691b6f0501663107eb28844eb6a433f1333b1ff3bf0cfd77dee02ecdd2
|
|
BLAKE2b-256 checksum How to use checksums |
2593268cc9c4616d9a8186f5dc1bb3fd04979174779ad82fe777e4c06e55031b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for log21 3.12.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.