Documentation for quicklogging¶
Resources¶
- doc: - read the doc on readthedocs (github rst is broken)
- source code: on github
- package:
- ci tests:
What is quicklogging¶
quicklogging is a Python logging
wrapper to
- remove a bit of logging boilerplate,
- redirect print output.
quicklogging
transparently provides a logger with a name relevant
to the code at hand:
Important
The name of the logger is the name of the module making the call.
For instance, if you log from project/models/chair.py
, your logger will be named project.models.chair
.
This is a very important feature:
Advantage #1 of this naming scheme
the configuration of thelogging.Logger
s and handlers is much easier —muting, changing verbosity for a particular piece of code etc
Advantage #2
we can provide aquicklogging.catch_prints()
and aquicklogging.warn_prints()
functionality to catch calls to print() from specific modules (typically: the module you’re editing).
Requirements¶
Python versions¶
I tested 3.5 to 3.10 without annoyances.
Cannot test, but should work because I don’t know of API changes:
- Python 2.7: testing NOT ok (Python 2.7 doesn’t have
importlib.abc.SourceLoader
Libs required¶
None ! unless you’re running the tests (then you need stringimporter). . So I’ve got this easy badge: .
Doc contents¶
(if toctree is not displayed, then build the docs with sphinx or read them on readthedocs : .