Skip to main content

A modern console logging module for Python but similar to JavaScript

Project description

consolex

If you're familiar with JavaScript and miss the console.log functionality in Python, consolex is perfect for you. It brings the same convenience and style, but with Python syntax!

consolex is a Python package that mimics the familiar JavaScript-style console logging in a modern and user-friendly way. With this package, you can easily print logs, warnings, errors, and success messages in the terminal using stylish icons and customizable options.

🚀 What's New in v2.0?

  • ✅ New primary() method
  • 🎀 New text colors
  • ⚙️ Improved formatting options (sep, end)
  • 🐛 Bug fixes and performance improvements

Features

  • log(): Print general messages to the console.
  • warn(): Print warning messages with a warning icon.
  • error(): Print error messages with an error icon.
  • success(): Print success messages with a success checkmark.
  • primary(): Print primary messages with color.

All methods support custom separators, line endings, and variable numbers of arguments, similar to JavaScript's console.log.

Examples

from consolex import console

# Print a log message
console.log("This is a log message.")

# Print a warning message
console.warn("This is a warning message.")

# Print an error message
console.error("This is an error message.")

# Print a success message
console.success("This is a success message.")

# Print a primary message
console.primary("This is a primary message.")

Installation

You can easily install consolex via pip:

pip install consolex

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

consolex-2.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

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

consolex-2.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file consolex-2.0.tar.gz.

File metadata

  • Download URL: consolex-2.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for consolex-2.0.tar.gz
Algorithm Hash digest
SHA256 7e6b5bb41c12b1178b6e00d96a90d3f2845f9a82b421a01cf1efc009a751fc12
MD5 57afeb1403497540b750114fad456448
BLAKE2b-256 ab7505e9cceb3552a9933821e08044840947ab0d871ba8c6c4ce08e068e78a1b

See more details on using hashes here.

File details

Details for the file consolex-2.0-py3-none-any.whl.

File metadata

  • Download URL: consolex-2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for consolex-2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c6d955e8df6529451b9bc1e3b7ed96e5785e3862363af9c11980ec18bc7f487
MD5 077569efc8c218c8c0648f8448259117
BLAKE2b-256 05f47367ef0966d713f89c6bb6a7adc6393d6cf1f7ad400a2b27b04276fc5ad5

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