# minilog
A minimalistic logging wrapper for Python.
[![Linux Build](https://img.shields.io/github/actions/workflow/status/jacebrowning/minilog/main.yml?branch=main&label=linux)](https://github.com/jacebrowning/minilog/actions)
[![Windows Build](https://img.shields.io/appveyor/ci/jacebrowning/minilog/main.svg?label=windows)](https://ci.appveyor.com/project/jacebrowning/minilog)
[![Code Coverage](https://img.shields.io/codecov/c/github/jacebrowning/minilog)](https://codecov.io/gh/jacebrowning/minilog)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/jacebrowning/minilog.svg)](https://scrutinizer-ci.com/g/jacebrowning/minilog)
[![PyPI License](https://img.shields.io/pypi/l/minilog.svg)](https://pypi.org/project/minilog)
[![PyPI Version](https://img.shields.io/pypi/v/minilog.svg)](https://pypi.org/project/minilog)
[![PyPI Downloads](https://img.shields.io/pypi/dm/minilog.svg?color=orange)](https://pypistats.org/packages/minilog)
## Usage
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
log = logging.getLogger(__name__)
def greet(name):
log.info("Hello, %s!", name)
if __name__ == "__main__":
logging.basicConfig(
level=logging.INFO,
format="%(levelname)s: %(name)s: %(message)s",
)
```
with this package you can simply:
```python
import log
def greet(name):
log.info("Hello, %s!", name)
if __name__ == "__main__":
log.init()
```
It will produce the exact same standard library `logging` records behind the scenes with automatic formatting for non-strings.
## Installation
Install this library directly into an activated virtual environment:
```text
$ pip install minilog
```
or add it to your [Poetry](https://poetry.eustace.io/) project:
```text
$ poetry add minilog
```
## Documentation
To view additional options, please consult the [full documentation](https://minilog.readthedocs.io/en/latest/logging/).
Raw data
{
"_id": null,
"home_page": "https://pypi.org/project/minilog",
"name": "minilog",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "logging",
"author": "Jace Browning",
"author_email": "jacebrowning@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e3/c9/6d4dc9bcd4b97ed89f482eeec0e6bb025942744689215dc2a4ed50415ea4/minilog-2.3.1.tar.gz",
"platform": null,
"description": "# minilog\n\nA minimalistic logging wrapper for Python.\n\n[![Linux Build](https://img.shields.io/github/actions/workflow/status/jacebrowning/minilog/main.yml?branch=main&label=linux)](https://github.com/jacebrowning/minilog/actions)\n[![Windows Build](https://img.shields.io/appveyor/ci/jacebrowning/minilog/main.svg?label=windows)](https://ci.appveyor.com/project/jacebrowning/minilog)\n[![Code Coverage](https://img.shields.io/codecov/c/github/jacebrowning/minilog)](https://codecov.io/gh/jacebrowning/minilog)\n[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/jacebrowning/minilog.svg)](https://scrutinizer-ci.com/g/jacebrowning/minilog)\n[![PyPI License](https://img.shields.io/pypi/l/minilog.svg)](https://pypi.org/project/minilog)\n[![PyPI Version](https://img.shields.io/pypi/v/minilog.svg)](https://pypi.org/project/minilog)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/minilog.svg?color=orange)](https://pypistats.org/packages/minilog)\n\n## Usage\n\nEvery 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:\n\n```python\nimport logging\n\nlog = logging.getLogger(__name__)\n\ndef greet(name):\n log.info(\"Hello, %s!\", name)\n\nif __name__ == \"__main__\":\n logging.basicConfig(\n level=logging.INFO,\n format=\"%(levelname)s: %(name)s: %(message)s\",\n )\n```\n\nwith this package you can simply:\n\n```python\nimport log\n\ndef greet(name):\n log.info(\"Hello, %s!\", name)\n\nif __name__ == \"__main__\":\n log.init()\n```\n\nIt will produce the exact same standard library `logging` records behind the scenes with automatic formatting for non-strings.\n\n## Installation\n\nInstall this library directly into an activated virtual environment:\n\n```text\n$ pip install minilog\n```\n\nor add it to your [Poetry](https://poetry.eustace.io/) project:\n\n```text\n$ poetry add minilog\n```\n\n## Documentation\n\nTo view additional options, please consult the [full documentation](https://minilog.readthedocs.io/en/latest/logging/).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Minimalistic wrapper for Python logging.",
"version": "2.3.1",
"project_urls": {
"Documentation": "https://minilog.readthedocs.io",
"Homepage": "https://pypi.org/project/minilog",
"Repository": "https://github.com/jacebrowning/minilog"
},
"split_keywords": [
"logging"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bc33731b5be35c83268725451d25eeac78fa0625e9d0c8f115ad3b1e5173737f",
"md5": "9dc74cbd791de6e736559b413ecb40e1",
"sha256": "1a679fefe6140ce1d59c3246adc991f9eb480169e5a6c54d2be9023ee459dc30"
},
"downloads": -1,
"filename": "minilog-2.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9dc74cbd791de6e736559b413ecb40e1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 8960,
"upload_time": "2024-08-24T14:29:29",
"upload_time_iso_8601": "2024-08-24T14:29:29.975894Z",
"url": "https://files.pythonhosted.org/packages/bc/33/731b5be35c83268725451d25eeac78fa0625e9d0c8f115ad3b1e5173737f/minilog-2.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e3c96d4dc9bcd4b97ed89f482eeec0e6bb025942744689215dc2a4ed50415ea4",
"md5": "5819301bc36a9117db170ad7cb5c910f",
"sha256": "4b602572c3bcdd2d8f00d879f635c0de9e632d5d0307e131c91074be8acf444e"
},
"downloads": -1,
"filename": "minilog-2.3.1.tar.gz",
"has_sig": false,
"md5_digest": "5819301bc36a9117db170ad7cb5c910f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 7364,
"upload_time": "2024-08-24T14:29:31",
"upload_time_iso_8601": "2024-08-24T14:29:31.239624Z",
"url": "https://files.pythonhosted.org/packages/e3/c9/6d4dc9bcd4b97ed89f482eeec0e6bb025942744689215dc2a4ed50415ea4/minilog-2.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-24 14:29:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jacebrowning",
"github_project": "minilog",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"appveyor": true,
"lcname": "minilog"
}