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
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-0.4.1b1.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for minilog-0.4.1b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c40ee773539ec6b5e6e902f32ab30fec302b4eea3aa1c2a695f41065c1753df |
|
MD5 | 84b5856b5f9f2f36127e114701db727d |
|
BLAKE2b-256 | 32898c5eb477d36fd680016ec1355cc5d0d40e62ac16df1eb21b9156563d961d |