Minimalistic wrapper for Python logging.
Project description
Unix: Windows:
Metrics:
Usage:
Overview
Every project should utilize logging, but for simple use cases, this requires a bit too much boilerplate. Instead of including all of this in your modules:
import logging
logging.basicConfig(
level=logging.INFO,
format="%(levelname)s: %(name)s: %(message)s",
)
log = logging.getLogger(__name__)
def greet(name):
log.info("Hello, %s!", name)
with this package you can simply:
import log
def greet(name):
log.info("Hello, %s!", name)
It will produce the exact same standard library logging
records behind the scenes.
Installation
$ pip install minilog
Revision History
1.1 (unreleased)
- Added
%(relpath)s
logging format. - Added
verbosity
asinit()
option to work with Django admin commands.
1.0 (2018-09-27)
- Initial stable release.
0.5 (2018-09-07)
- Disabled automatic logging configuration when invoked by
pytest
.
0.4 (2018-4-28)
- Added
reset=True
asinit()
option to replace all existing logging handlers. - Added
exception
logging API. - Added convenience alias:
log.c
,log.exc
.
0.3.1 (2018-03-30)
- Fixed bug where records were written for disabled levels.
0.3 (2018-03-15)
- Exposed
logging
level constants on thelog
package. - Added
log.WARN
as an alias oflog.WARNING
.
0.2.1 (2018-03-04)
- Removed the Python version check on installation.
0.2 (2018-03-03)
- Added method to force logging format:
log.init(format="...")
- Added method to silenced named loggers:
log.silence('requests', allow_error=True)
- Added convenience aliases:
log.d
,log.i
,log.w
,log.e
0.1 (2018-03-03)
- Initial release.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
minilog-1.1b1.tar.gz
(8.2 kB
view details)
Built Distribution
File details
Details for the file minilog-1.1b1.tar.gz
.
File metadata
- Download URL: minilog-1.1b1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b429cc09bfa84227036ad6877de4b072fff25111da3f67d01a7d52542bc4ee43
|
|
MD5 |
9133b959284e954f386a075f35e43efc
|
|
BLAKE2b-256 |
fd77dc9e2808b7f351260125562b3353503c6741741febc0a44e6aca2a02cd94
|
File details
Details for the file minilog-1.1b1-py3-none-any.whl
.
File metadata
- Download URL: minilog-1.1b1-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
f7f0f3cbe97efc8ddf8e2a295b96e5909436b2a20f2ee0a0bb578acfc97307f6
|
|
MD5 |
0cd26f78fe31da8baba8d3c8fd01267e
|
|
BLAKE2b-256 |
0cf0bc99b361b108cc668758302985240826d2d3e64ff5c93e75c6aa654dcb59
|