logma
Great default logging.
Usage
Install:
% pip install logma
Example file:
% cat example/logex.py
from logma.wech import datlog
import structlog
# auto detects tty and outputs json or text accordingly
datlog()
log = structlog.get_logger("logex")
def main():
log.info("Hello")
log.warn("Hello")
log.error("Hello")
log.debug("Hello")
if __name__ == "__main__":
main()
Usage in the console (it uses colorama):
% env/bin/python example/logex.py
2020-03-04T11:27:41.523012Z [info ] Hello [logex] func=main lineno=13 module=__main__
2020-03-04T11:27:41.529786Z [warning ] Hello [logex] func=main lineno=14 module=__main__
2020-03-04T11:27:41.529982Z [error ] Hello [logex] func=main lineno=15 module=__main__
2020-03-04T11:27:41.530156Z [debug ] Hello [logex] func=main lineno=16 module=__main__
Usage in background (json output to stderr):
% env/bin/python example/logex.py &> logex.log && cat logex.log
{"event": "Hello", "level": "info", "logger": "logex", "timestamp": "2020-03-04T11:28:17.565149Z", "module": "__main__", "lineno": 13, "func": "main"}
{"event": "Hello", "level": "warning", "logger": "logex", "timestamp": "2020-03-04T11:28:17.571626Z", "module": "__main__", "lineno": 14, "func": "main"}
{"event": "Hello", "level": "error", "logger": "logex", "timestamp": "2020-03-04T11:28:17.571821Z", "module": "__main__", "lineno": 15, "func": "main"}
{"event": "Hello", "level": "debug", "logger": "logex", "timestamp": "2020-03-04T11:28:17.571995Z", "module": "__main__", "lineno": 16, "func": "main"}
Metadata
Release files for logma 0.4.0
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 |
|---|---|---|---|---|
| logma-0.4.0.tar.gz | 6.7 kB | Without provenance | Details for logma-0.4.0.tar.gz |
Release files / logma-0.4.0.tar.gz
| Download URL | logma-0.4.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35ae9abc079fcba92031b638fab5438a38c58ab2f0d4ae8684c0760b1ea864ee
|
|
BLAKE2b-256 checksum How to use checksums |
f9db2fcc806f46111272c7965aec72dda7d4f8e0300ba92ceac903cc905c163f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.6.7
|
Security for logma 0.4.0
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.