Sprawl
A utility package for printing formatted, colorized log messages.
Why?
Sometimes we fall back to good ol' print-driven development ("PDD") when we need to inspect values at runtime. It can be annoying to search through a terminal window filled with other logs to find the one log statement you're looking for. This makes it easy for your log messages to stand out.
Installation
$ pip install sprawl
Usage
Import the log function:
from sprawl.loud_log import log
Configure logging however you normally would, for example:
logging.basicConfig(format='%(asctime)s \n %(message)s', level=logging.INFO)
log a message using the defaults:
log('my log message')
prints:
##################################
my log message
##################################
Center the log message:
log('my log message', center_message=True)
prints:
##################################
my log message
##################################
Change the surrounding character:
log('my log message', center_message=True, char_to_surround_with='~')
prints:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
my log message
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add some color:
log('my log message', center_message=True, color='yellow')
prints:
Log the name of the function or module from within which this log() was called
def my_amazing_function():
log('my log message', center_message=True, print_func_name=True)
my_amazing_function()
prints:
log called from my_amazing_function
#################################
my log message
#################################
Metadata
Release files for sprawl 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sprawl-0.1.2.tar.gz | 2.7 kB | Without provenance | Details for sprawl-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sprawl-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for sprawl-0.1.2-py3-none-any.whl |
Total release size: 5.5 kB
Release files / sprawl-0.1.2.tar.gz
| Download URL | sprawl-0.1.2.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a6590b2d0084d6f5bfb301e807b2b5c314d31dd2448835783dcf04966f877a1
|
|
BLAKE2b-256 checksum How to use checksums |
e89768e020dbb238d098e858b7de39f009ca8f8df0ca2e2ba97840f22ecea89e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.7.3 Darwin/17.7.0
|
Release files / sprawl-0.1.2-py3-none-any.whl
| Download URL | sprawl-0.1.2-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da3c8f240ccebec5c58d52e771f738d3d7c000e7a9e8ff02745804b2722db327
|
|
BLAKE2b-256 checksum How to use checksums |
29bc50dde8efb39967ba4a8bfa8455100c739cf1462f862c648ae3d49c026d0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.17 CPython/3.7.3 Darwin/17.7.0
|
Security for sprawl 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.