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, 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


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.4.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.4-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

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

Hashes for consoleprintpy-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ea2bee23453efa23d412d6dcfa06882b765d3de06184e785337f8652d71650d8
MD5 a63fd135068ae276223a66dc5fda0351
BLAKE2b-256 0da4a1fd2a8ab1335a0d79b59d482f1f583e40127798e6209e0c20c8880a0e59

See more details on using hashes here.

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

Hashes for consoleprintpy-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4b26b974e4b3234adad73a4944a62aa675ce7e4aec91e3bad86fdbb65be6eeb7
MD5 87b9b41f043ea6ce3b483ef736e7f1fb
BLAKE2b-256 3afc604f27584920de3e1b1375c9aeb054187a4e8ca87f01b3911d76db3c4f8d

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