Logquicky
Nicer python logging in one line
The python logging package from the standard library is awesome and its certainly much better than sprinkling print() statement all over your code.
However, even hough setting it up takes just a few lines of code, configuring it to make it look nice across projects, just adds up to doing the same thing over and over.
Therefore, I created logquicky.
Because this is basically just a very simple configuration on the logging module, which also makes it very easy to fall back to it once you decide your project needs more advanced functionalities. However, it hopes to save you some time when quickly building scripts or when getting started in a new project.
Finally, this is also my first (hopefully useful) little OpenSource contribution up on PyPI, so I figured it would be a good exercise.
Features
- Colored log levels make it easy to identify different levels.
- Pre-configured formatting of log lines,
- Optional logging to a log file,
- Ability to rewrite lines for nicer progress bars etc.
- Based on Python's logging module.
Installation
pip install logquicky
Notes
logquicky is supported for python 3.6+ (due to usage of f-strings)
How to use
Basic example
import logquicky
# Add this line to create your logger.
log = logquicky.load('my-logger')
# Start logging!
log.info("This is a log message")
See how it looks in action
Logging from multiple files
#!/usr/bin/env python
# --- example2.py ---
import logquicky
import other_file
# Creates a new logger and returns it.
log = logquicky.load('my-logger')
log.info("I can log from here...")
# --- example2_other_file.py ---
import logquicky
log = logquicky.load('my-logger')
def run():
log.info("And from here as well!")
Result:
2019-02-28 12:16:56 my-logger [INFO] I can log from here...
2019-02-28 12:16:56 my-logger [INFO] And from here as well!
Metadata
Release files for logquicky 0.0.6
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 | |
|---|---|---|---|---|
| logquicky-0.0.6.tar.gz | 4.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| logquicky-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.7 kB
Release files / logquicky-0.0.6.tar.gz
| Download URL | logquicky-0.0.6.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dde66e590113bae0bdcd656f087d39a6d84c7ffc7fe0f4d1b273760bbacf0aeb
|
|
BLAKE2b-256 checksum How to use checksums |
ba66d3973e85faa9766176659eaea2b905f56e82441bea9cbfa837b3ec4babbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
|
Release files / logquicky-0.0.6-py3-none-any.whl
| Download URL | logquicky-0.0.6-py3-none-any.whl |
|---|---|
| Size | 17.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
51fead659abb1a5d90281cb27a508cce404e1aa82223a02486805f17cdf55109
|
|
BLAKE2b-256 checksum How to use checksums |
9eff8f8e95c58116591662bac6981f3f9bfd7f4bedd7ddf5364b46b0597f3ca2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
|
Security for logquicky 0.0.6
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.