JS-like console logging for Python with colors and styles
Project description
ConsolePy
JS-like console logging for Python with colors, styles, and CLI.
Features
- Styled console output with colors, bold, underline, strike, markdown parsing
- Logging levels: DEBUG, INFO, SUCCESS, FAILURE, WARN, ERROR
- Automatic timestamp support
- JSON logs and file logging (
out.log,err.log) - JS-like methods:
console.print,console.debug,console.info,console.warn,console.error,console.success,console.failure,console.exception - CLI: run Python scripts with consolepy fully configured
- Configurable via
.consolepy.toml - Automatic log rotation
Using CLI
consolepy run myscript.py
Installation
pip install consoleprintpy
Usage
from consolepy import console
console.print("[green+bold:**Success!**] __All done__")
console.debug("Debug info")
console.info("Information")
console.warn("Warning!")
console.error("Error!")
console.success("Operation succeeded")
console.exception("Exception caught", context=True)
Config via .consolepy.toml
level = "DEBUG" json = true no_timestamp = false log_rotation = true out_file = "out.log" err_file = "err.log"
CLI Flags Override
consolepy run myscript.py --level INFO --no-timestamp --json
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file consoleprintpy-0.1.4.tar.gz.
File metadata
- Download URL: consoleprintpy-0.1.4.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea2bee23453efa23d412d6dcfa06882b765d3de06184e785337f8652d71650d8
|
|
| MD5 |
a63fd135068ae276223a66dc5fda0351
|
|
| BLAKE2b-256 |
0da4a1fd2a8ab1335a0d79b59d482f1f583e40127798e6209e0c20c8880a0e59
|
File details
Details for the file consoleprintpy-0.1.4-py3-none-any.whl.
File metadata
- Download URL: consoleprintpy-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b26b974e4b3234adad73a4944a62aa675ce7e4aec91e3bad86fdbb65be6eeb7
|
|
| MD5 |
87b9b41f043ea6ce3b483ef736e7f1fb
|
|
| BLAKE2b-256 |
3afc604f27584920de3e1b1375c9aeb054187a4e8ca87f01b3911d76db3c4f8d
|