{"id":1990716,"url":"https://github.com/georgeyk/belogging","last_synced_at":"2025-05-01T02:30:31.632Z","repository":{"id":57414584,"uuid":"67264993","full_name":"georgeyk/belogging","owner":"georgeyk","description":"Easy and opinionated logging configuration for Python apps","archived":false,"fork":false,"pushed_at":"2024-12-18T20:02:38.000Z","size":43,"stargazers_count":22,"open_issues_count":0,"forks_count":5,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-25T19:55:01.678Z","etag":null,"topics":["library","logging","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/georgeyk.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-03T01:41:21.000Z","updated_at":"2024-12-18T20:02:21.000Z","dependencies_parsed_at":"2022-09-10T05:11:26.719Z","dependency_job_id":null,"html_url":"https://github.com/georgeyk/belogging","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgeyk%2Fbelogging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgeyk%2Fbelogging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgeyk%2Fbelogging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/georgeyk%2Fbelogging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/georgeyk","download_url":"https://codeload.github.com/georgeyk/belogging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251812241,"owners_count":21647870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","logging","python3"],"created_at":"2024-01-20T15:38:22.356Z","updated_at":"2025-05-01T02:30:31.625Z","avatar_url":"https://github.com/georgeyk.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"Belogging\n=========\n\n*Don't fight with logging ...*\n\n|Coverage Status| |PyPI Version| |PyPI License| |PyPI latest|\n\n----\n\nEasy logging configuration based on environment variables.\n\nFeatures:\n\n* Set logging level using environment variable LOG_LEVEL (defaults to `INFO`)\n* Set which loggers to enable using environment variable `LOGGERS` (defaults to `''`, everything)\n* Always output to stdout\n* Optional JSON formatter\n* Completely disable logging setting `LOG_LEVEL=DISABLED`\n\nRequirements:\n\n* Python 3.10+\n\nInstall:\n\n.. code-block:: bash\n\n   pip install belogging\n\n\nExamples:\n---------\n\nSimple applications:\n~~~~~~~~~~~~~~~~~~~~\n\n.. code-block:: python\n\n    # my_script.py\n\n    import belogging\n    belogging.load()\n    # ^^ this call is optional, only useful for customization\n    # For example, to enable JSON output: belogging.load(json=True)\n\n    # belogging.getLogger is just a sugar to logging.getLogger, you can\n    # use logging.getLogger as usual (and recommended).\n    logger = belogging.getLogger('foobar')\n    logger.debug('test 1')\n    logger.info('test 2')\n\n\nExecuting:\n\n.. code-block:: bash\n\n    # selecting LOG_LEVEL\n    $ LOG_LEVEL=DEBUG python my_script.py\n    # level=DEBUG message=test 1\n    # level=INFO message=test 2\n\n    # selecting LOGGERS\n    $ LOGGERS=foobar python my_script.py\n    # Both messages\n\n    # Both\n    $ LOGGERS=foobar LOG_LEVEL=INFO my_script.py\n    # only level=INFO message=test 2\n\n\nApplications should call ```belogging.load()``` upon initialization.\nThe first ```__init__.py``` would be a good candidate, but anything before any call to\n```logging``` module will be fine.\n\n\nDjango:\n~~~~~~~\n\n\nIn your projects ```settings.py```:\n\n.. code-block:: python\n\n    import belogging\n    # Disable django logging setup\n    LOGGING_CONFIG = None\n    belogging.load()\n\n\nInside your code, just use ```logging.getLogger()``` as usual.\n\n.. code-block:: bash\n\n    $ export LOG_LEVEL=WARNING\n    $ ./manage.py runserver\n    # It will output only logging messages with severity \u003e WARNING\n\n\nLogging follows a hierarchy, so you easily select or skip some logging messages:\n\n\n.. code-block:: bash\n\n    $ export LOGGERS=my_app.critical_a,my_app.critical_c,my_lib\n    $ ./my-app.py\n    # \"my_app.critical_b messages\" will be skipped\n    # all messages from my_lib will show up\n\n\n.. |Coverage Status| image:: https://coveralls.io/repos/github/georgeyk/belogging/badge.svg?branch=master\n   :target: https://coveralls.io/github/georgeyk/belogging?branch=master\n.. |PyPI Version| image:: https://img.shields.io/pypi/pyversions/belogging.svg?maxAge=2592000\n   :target: https://pypi.python.org/pypi/belogging\n.. |PyPI License| image:: https://img.shields.io/pypi/l/belogging.svg?maxAge=2592000\n   :target: https://pypi.python.org/pypi/belogging\n.. |PyPI latest| image:: https://img.shields.io/pypi/v/belogging.svg?maxAge=2592000\n   :target: https://pypi.python.org/pypi/belogging\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgeyk%2Fbelogging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorgeyk%2Fbelogging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorgeyk%2Fbelogging/lists"}