Skip to main content

A lightweight library for clean console output

Project description

sane-out for Python

A lightweight library for clean console output

Install

With pip:

pip install sane-out

With Poetry:

poetry add sane-out

With pipenv:

pipenv install sane-out

Use

Default behaviour

from sane_out import out

out("This is an info message")
out.info("This is an info message too")

out.debug("This is a debug message. It won't be printed without 'verbose=True'")
out.verbose = True
out.debug("Now this debug message will be printed")

out.warning("Warning! This is a message that will be printed to stderr")

out.error("Your code will print an error message crash with code -1!")
out.error("You can crash your program with a custom code", 42)

out.calm_error("You can also print an error message without crashing")

Custom instance

from sane_out import _SanePrinter

# Setup your output with constructor params

talkative = _SanePrinter(verbose=True, colour=True)
boring = _SanePrinter(verbose=False, colour=False)

talkative.debug("Shhh... This is a debug message")
boring.debug("I will not print this")
boring.warning("And this won't have amy colour")

License

MIT © Nikita Karamov

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

sane-out-0.2.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

sane_out-0.2.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file sane-out-0.2.1.tar.gz.

File metadata

  • Download URL: sane-out-0.2.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Darwin/19.6.0

File hashes

Hashes for sane-out-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6b89ba96e10950443103fbda533b9862cc03012166caad21f76c2b7dd051ea31
MD5 ba929be565dce5c3c3993ba3b91f3bb3
BLAKE2b-256 e558ed48e077b23202aba8c77d249bc2d4e2e0af79cb02f95ff013880de3c945

See more details on using hashes here.

File details

Details for the file sane_out-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: sane_out-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.0 Darwin/19.6.0

File hashes

Hashes for sane_out-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65846a4474ca7c99ca151fb08c8ff701b5984dfbe7d0255af617e5cbb513d6b6
MD5 dc985cbb076dc0008faa8cdabd930d71
BLAKE2b-256 e069adbcd9552b4c87a6fe652f5e75932010352cf1b681b532e6279fa2b4de2b

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