Skip to main content

A console logging/debugging framework inspired by ECMAScript

Project description

consolejs

A console logger / debugger for Python CLI programs

Currently consolejs only support functions. support for classes will be added later.

Installation

$ pip install consolejs

Getting Started

# Create a Conlog from the constructor.
consolejs = Conlog.create("main")

# Set the required logging level
consolejs.level = Conlog.DEBUG

# To use on the `main` module
console = consolejs.get_console()

####  in module2.py

@Conlog.fn
def say_hi(name):
	console = Conlog.get_console("main")
	console.debug("args {name=}")
	print(f"Hi {name}"

How it works.

console.debug supports expr debug expressions introduced in Python 3.8. It dynamically rewrites the function in Python 3.8 and uses a beautiful way to support it in < 3.7

See tests/ for samples.

License


Copyright (c) 2019 Cswl Coldwind

consolejs is distributed under the terms

  • MIT License <https://choosealicense.com/licenses/mit>_

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

consolejs-1.0.9.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

consolejs-1.0.9-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file consolejs-1.0.9.tar.gz.

File metadata

  • Download URL: consolejs-1.0.9.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.5

File hashes

Hashes for consolejs-1.0.9.tar.gz
Algorithm Hash digest
SHA256 b68bf509fa06ccaea974c9161c991341820cd065da2276392b3737e4eee322c5
MD5 6cf95cf31b38d5c59ef9692f81a90860
BLAKE2b-256 11902e3d520a06256fbfd088b65b2f5cafb324cf7e223387cee9bb4dd185b733

See more details on using hashes here.

File details

Details for the file consolejs-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: consolejs-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.5

File hashes

Hashes for consolejs-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 32c4fca3cd2ba69ca16ba2555c7c82b656da26dd2ace6b27b60f0e8ba1a541a2
MD5 ea78a17f3d59a6a83adec8d00d628011
BLAKE2b-256 06583ff7f92687f89c2fcac0358ca28d962e1daec3ea55e5e5f347e9266cd012

See more details on using hashes here.

Supported by

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