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

Uploaded Python 3

File details

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

File metadata

  • Download URL: consoleprintpy-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 9ff7ef24abb07862e3acbb5c5f48a3d4b157d75ea0e8e9e582472a9bb5964d2b
MD5 89f1dd7234a50164fc8a311c9e0989f9
BLAKE2b-256 bbe54c99d40b3fd53535e5ddb67b68f917a18621b1c55928c7438fc4ed1a2955

See more details on using hashes here.

File details

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

File metadata

  • Download URL: consoleprintpy-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f610f5a258ac52432657f17f39dd93382b102c23ba4bc8ddc1acadfbd66d4b00
MD5 346b1094888b8b71da279e8663213afd
BLAKE2b-256 fb17576e490aa130da0312ebcf2d82281e7e6ffedc874a5d56a3be097b3a6eac

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