Skip to main content

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, 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.exception
  • CLI: run Python scripts with consolepy fully configured
  • Configurable via .consolepy.toml
  • Automatic log rotation

Using CLI

consolepy run myscript.py

Installation

# Local development
git clone <repo>
cd consolepy
pip install -e .

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

consoleprintpy-0.1.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

consoleprintpy-0.1.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file consoleprintpy-0.1.2.tar.gz.

File metadata

  • Download URL: consoleprintpy-0.1.2.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

Hashes for consoleprintpy-0.1.2.tar.gz
Algorithm Hash digest
SHA256 23de6bcb7710825a4bffb35a5fb9fa68db0bddcb0e76fb3ce6512ebb1343d811
MD5 3299cae9386abf01adf5284df13a83c0
BLAKE2b-256 f31a5b42c05338dff3dd4d1fe2523a6b1d1ccc0e3fcb6402190e0e28bbdd8149

See more details on using hashes here.

File details

Details for the file consoleprintpy-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: consoleprintpy-0.1.2-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

Hashes for consoleprintpy-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a40b795e7abcc058e81855d060da2a8745f54ccc8c02a2ad15d152fcbc110b0f
MD5 17872c2a7e53feefcb1331b23aaa286e
BLAKE2b-256 17be37ef38eb43481cc6bb8d3e5ceb0efd50f1f471da9da9ec3026b92b2e640d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page