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.10.3
ColorizingHelpFormatter colors are now private and evaluated to ANSI
codes once in __init__. New get_colors()/set_colors() methods let
users inspect and customize colors with human-readable names. This also
fixes ColorizingArgumentParser(colors={...}), whose custom colors were
silently dropped.
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
Release files for log21 3.10.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| log21-3.10.3.tar.gz | 94.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| log21-3.10.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 196.0 kB
Release files / log21-3.10.3.tar.gz
| Download URL | log21-3.10.3.tar.gz |
|---|---|
| Size | 94.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c988a0dc4ea955cea64db036f583ae0305433e12968a9e006c6d0600c59cef60
|
|
BLAKE2b-256 checksum How to use checksums |
448bc49e745d7549045efff06783668c8cbc0f85f98f777f8b667d9153fe1701
|
| 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.10.3-py3-none-any.whl
| Download URL | log21-3.10.3-py3-none-any.whl |
|---|---|
| Size | 102.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4e857e92fdd3241f9c5c262e8e17a2135d58fbc881e94d6d1f6f8a031b30cf75
|
|
BLAKE2b-256 checksum How to use checksums |
b34de778fcb59bace2e6f80e0303eb9a3468ff984ed4de74f30ef448b873bef2
|
| 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}
|