Metadata-Version: 2.1
Name: bxlogs
Version: 0.1.0
Summary: simple logs config
Home-page: https://github.com/Bixoto/bxlogs
License: MIT
Author: Baptiste Fontaine
Author-email: baptiste@bixoto.com
Requires-Python: >=3.8,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Description-Content-Type: text/markdown

# bxlogs

**bxlogs** is a minimal Python module for a basic logging setup. It exposes a single function, `get_logger`, which acts
as a wrapper around `logging.getLogger` to set a default output on stderr with a sensible format. That’s all.


## Install

With pip:

    pip install bxlogs

With poetry:

    poetry add bxlogs


## Usage

```python
from bxlogs import get_logger

logger = get_logger("my.module")
logger.info("all set!")
```

The default level is `INFO`.

You can set the level to `DEBUG` using various means:
* `debug=True`
* `level="DEBUG"` or `level=logging.DEBUG`
* Set the environment variable `BX_DEBUG`

```python
from bxlogs import get_logger

# All the calls below are equivalent

logger = get_logger("my.module", debug=True)
logger = get_logger("my.module", level="DEBUG")

import logging
logger = get_logger("my.module", level=logging.DEBUG)

import os
os.environ["BX_DEBUG"] = "1"
logger = get_logger("my.module")
```

You can set any other level using `level=`.

There’s nothing more. If you need anything more complex than that, use the Python `logging` module directly.

