Skip to main content

log21

version pipeline status

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_print function, 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.

Issues contributors

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.7.1

Logger.isEnabledFor now honors the two standard silencing mechanisms: logger.disabled = True silences the logger (including PRINT/INPUT), and logging.disable(level) suppresses records at or below the threshold while keeping higher custom levels enabled. Previously neither had any effect on log21 loggers, so host applications couldn't quiet library logging through the normal stdlib contracts. Also new: log21.disable(level) sets the threshold on both managers at once, so no import logging is needed.

Full CHANGELOG

Usage Examples

See EXAMPLES.md

About

Author: CodeWriter21 (Mehrad Pooryoussof)

GitLab: CodeWriter21

Telegram Channel: @CodeWriter21

License

License

apache-2.0

Donate

In order to support this project you can donate some crypto of your choice 8D

Donate Addresses

Or if you can't, give this project a star on GitLab :)

References

Release files for log21 3.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for log21 3.7.1
File Size Uploaded
log21-3.7.1.tar.gz 91.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for log21 3.7.1
File Interpreter ABI Platform
log21-3.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 190.7 kB

Release files / log21-3.7.1.tar.gz

Download URL log21-3.7.1.tar.gz
Size 91.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0ee17679228e30dc5b4ccc4c5cbe2b6344e1cc55c096e14c4c841be8823cb915
BLAKE2b-256 checksum
How to use checksums
a1380a7d7a9aaaa08e6bb235e58b32343d6490ba238fcdf9d4a1240e0d20caad
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.7.1-py3-none-any.whl

Download URL log21-3.7.1-py3-none-any.whl
Size 99.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c21522c3f0b86c560bf3ad2432b31699a6a771c575e62db30ac3a81337f8dfd
BLAKE2b-256 checksum
How to use checksums
d3e0dad29a18ad1bf018f5798dd63cc0e606243729e2224ad6245f89f8493e4a
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 history Release notifications | RSS feed

3.12.2

2 release files

3.12.1

2 release files

3.12.0

2 release files

3.11.0

2 release files

3.10.3

2 release files

3.10.2

2 release files

3.9.0

2 release files

3.8.0

2 release files

This release

3.7.1 This release

2 release files

3.7.0

2 release files

3.6.0

2 release files

3.5.0

2 release files

3.4.0

2 release files

3.3.3

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.10.0

2 release files

2.9.2

2 release files

2.9.1

2 release files

2.9.0

2 release files

2.8.1

2 release files

2.8.0

2 release files

2.7.1

2 release files

2.7.0

2 release files

2.6.2

2 release files

2.6.1

2 release files

2.6.0

2 release files

2.5.4

2 release files

2.5.3

2 release files

2.5.2

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.7

2 release files

2.4.6

2 release files

2.4.5

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.10

2 release files

2.3.9

2 release files

2.3.8

2 release files

2.3.7

2 release files

2.3.6

2 release files

2.3.5

2 release files

2.3.4

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.5.10

2 release files

1.5.9

2 release files

1.5.8

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.9

2 release files

1.4.8

2 release files

1.4.7

2 release files

1.4.6

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page