bxlogs


Namebxlogs JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/Bixoto/bxlogs
Summarysimple logs config
upload_time2023-06-27 14:02:47
maintainer
docs_urlNone
authorBaptiste Fontaine
requires_python>=3.8,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Bixoto/bxlogs",
    "name": "bxlogs",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Baptiste Fontaine",
    "author_email": "baptiste@bixoto.com",
    "download_url": "https://files.pythonhosted.org/packages/9f/8d/5acd69f5b843a66d10c03a90b2a24cd8acec8b3bea044e3fb472303a919f/bxlogs-0.1.0.tar.gz",
    "platform": null,
    "description": "# bxlogs\n\n**bxlogs** is a minimal Python module for a basic logging setup. It exposes a single function, `get_logger`, which acts\nas a wrapper around `logging.getLogger` to set a default output on stderr with a sensible format. That\u2019s all.\n\n\n## Install\n\nWith pip:\n\n    pip install bxlogs\n\nWith poetry:\n\n    poetry add bxlogs\n\n\n## Usage\n\n```python\nfrom bxlogs import get_logger\n\nlogger = get_logger(\"my.module\")\nlogger.info(\"all set!\")\n```\n\nThe default level is `INFO`.\n\nYou can set the level to `DEBUG` using various means:\n* `debug=True`\n* `level=\"DEBUG\"` or `level=logging.DEBUG`\n* Set the environment variable `BX_DEBUG`\n\n```python\nfrom bxlogs import get_logger\n\n# All the calls below are equivalent\n\nlogger = get_logger(\"my.module\", debug=True)\nlogger = get_logger(\"my.module\", level=\"DEBUG\")\n\nimport logging\nlogger = get_logger(\"my.module\", level=logging.DEBUG)\n\nimport os\nos.environ[\"BX_DEBUG\"] = \"1\"\nlogger = get_logger(\"my.module\")\n```\n\nYou can set any other level using `level=`.\n\nThere\u2019s nothing more. If you need anything more complex than that, use the Python `logging` module directly.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "simple logs config",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/Bixoto/bxlogs"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c475ba8fc677f922611f8edd5125295eca7fd27d3b1f847bc2f29794b9f993c7",
                "md5": "05e3622e17d6713d2f56e8db3bc943ee",
                "sha256": "5fa33bb8a8100210d210b03317b29ec3748232f6f628953d558436d21587df0e"
            },
            "downloads": -1,
            "filename": "bxlogs-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "05e3622e17d6713d2f56e8db3bc943ee",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 3298,
            "upload_time": "2023-06-27T14:02:45",
            "upload_time_iso_8601": "2023-06-27T14:02:45.623884Z",
            "url": "https://files.pythonhosted.org/packages/c4/75/ba8fc677f922611f8edd5125295eca7fd27d3b1f847bc2f29794b9f993c7/bxlogs-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9f8d5acd69f5b843a66d10c03a90b2a24cd8acec8b3bea044e3fb472303a919f",
                "md5": "962310c3a849f3da56456fe3debf54b2",
                "sha256": "c4832c0de37207f5772cf090a3868cced687ad8aac6eb8812a0310affefbf26a"
            },
            "downloads": -1,
            "filename": "bxlogs-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "962310c3a849f3da56456fe3debf54b2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 2682,
            "upload_time": "2023-06-27T14:02:47",
            "upload_time_iso_8601": "2023-06-27T14:02:47.068859Z",
            "url": "https://files.pythonhosted.org/packages/9f/8d/5acd69f5b843a66d10c03a90b2a24cd8acec8b3bea044e3fb472303a919f/bxlogs-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-27 14:02:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Bixoto",
    "github_project": "bxlogs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "bxlogs"
}
        
Elapsed time: 0.28974s