Minimalistic wrapper for Python logging.
Project description
Unix: [](https://travis-ci.org/jacebrowning/minilog) Windows: [](https://ci.appveyor.com/project/jacebrowning/minilog)<br>Metrics: [](https://coveralls.io/r/jacebrowning/minilog) [](https://scrutinizer-ci.com/g/jacebrowning/minilog/?branch=develop)<br>Usage: [](https://pypi.python.org/pypi/minilog)
Unix: [](https://travis-ci.org/jacebrowning/minilog) Windows: [](https://ci.appveyor.com/project/jacebrowning/minilog)<br>Metrics: [](https://coveralls.io/r/jacebrowning/minilog) [](https://scrutinizer-ci.com/g/jacebrowning/minilog/?branch=develop)<br>Usage: [](https://pypi.org/project/minilog)
# 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:
```python
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:
```python
import log
def greet(name):
log.info("Hello, %s!", name)
```
It will produce the exact same standard library `logging` records behind the scenes.
# Installation
```sh
$ pip install minilog
```
# Revision History
## 0.4 (unreleased)
- Added `reset=True` as `init()` 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 the `log` package.
- Added `log.WARN` as an alias of `log.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.
Unix: [](https://travis-ci.org/jacebrowning/minilog) Windows: [](https://ci.appveyor.com/project/jacebrowning/minilog)<br>Metrics: [](https://coveralls.io/r/jacebrowning/minilog) [](https://scrutinizer-ci.com/g/jacebrowning/minilog/?branch=develop)<br>Usage: [](https://pypi.org/project/minilog)
# 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:
```python
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:
```python
import log
def greet(name):
log.info("Hello, %s!", name)
```
It will produce the exact same standard library `logging` records behind the scenes.
# Installation
```sh
$ pip install minilog
```
# Revision History
## 0.4 (unreleased)
- Added `reset=True` as `init()` 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 the `log` package.
- Added `log.WARN` as an alias of `log.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.4b2.tar.gz
(6.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minilog-0.4b2.tar.gz.
File metadata
- Download URL: minilog-0.4b2.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac00ab2dc98506a741207ad24ee5e57377b69bc65fb40838f3b10eddd90d6736
|
|
| MD5 |
1077458375a9bcb62d12b690b0c57409
|
|
| BLAKE2b-256 |
7205f050e96d4fc623055bcfc98e6ad4101d48236a2cc24ddf50794cd35c21b6
|
File details
Details for the file minilog-0.4b2-py3-none-any.whl.
File metadata
- Download URL: minilog-0.4b2-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f158100753db17732d5068417263264c3e6e166f8bd99e50a75a30529b2b8b3
|
|
| MD5 |
f286de71200d3d618282325f6284bea5
|
|
| BLAKE2b-256 |
ee1dd19802964930ab56b4f87245fa266d08a7bf55be8b58a2807105dcc03f81
|