Metadata-Version: 2.4
Name: rvid.log
Version: 0.0.2
Summary: Single-file, zero-dependency, highly compatible logger
Author-email: Arvid Müllern-Aspegren <kontakt@rvid.se>
License-Expression: MIT
Project-URL: repository, https://hg.sr.ht/~rvid/rvid.log
Requires-Python: >=3.6.2
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: mypy; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Dynamic: license-file

rvid.log - a nice single-file logger
====================================

Single-file, zero-dependency, highly compatible logger with useful defaults and
convenient features.

My only real objections against the basic logging functionality in Python
stdlib are that its default formatter doesn't have the basic information I
always want and that it is too fiddly to adjust log levels.

You can just copy the single file into any project and name it anything.

Example
-------

```
$ cat > test.py <<EOF
from rvid.log import getLogger
log = getLogger(name=None)
log.info("This is informational")
log.debug("This is mostly noise")
EOF

$ python test.py
[2026-03-07 23:30:39] INFO [test.py] This is informational

$ LOGGING_LEVEL=DEBUG python test.py
[2026-03-07 23:31:46] INFO [test.py] This is informational
[2026-03-07 23:31:46] DEBUG [test.py] This is mostly noise

$ LOGGING_PATH=test.log python test.py

$ cat test.log
[2026-03-07 23:31:59] INFO [test.py] This is informational
```

Other features
--------------

 * Extra levels `TRACE` (below `DEBUG`) and `IMPORTANT` (between `WARNING` and
   `ERROR`).
 * You can set log-level by logger-name, simply add more text after 
   LOGGING_LEVEL like this: ``LOGGING_LEVEL_MYPACKAGE_SUBPACKAGE=DEBUG``. and
   now loggers with name "mypackage.subpackage" will have DEBUG level but all
   others are left on default. You can have as many of these variables as you
   want in your environment.
 * Allows output to multiple sinks from single logger 
 * Single central flip to switch, if you wish to route all log statements 
   through stdlib logging instead.
