qstd-logger-json-formatter


Nameqstd-logger-json-formatter JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/QuisEgoSum/qstd-logger-json-formatter
SummaryLogging json formatter
upload_time2024-05-01 10:11:13
maintainerNone
docs_urlNone
authorQuisEgoSum
requires_python>=3.7
licenseMIT
keywords logging json formatter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            

# Logging Json Formatter


```python
import logging
from qstd_logger_json_formatter import JsonFormatter, configure

JsonFormatter\
    .set_parse_payload_root_logger('app')\
    .set_formatter(
        'sanic.access',
        lambda record: dict(
            level=record.levelname,
            message=record.message,
            host=record.host,
            request=record.request,
            status=record.status,
            byte=record.byte,
            label=record.name,
            pname=record.processName,
            pid=record.process,
            timestamp=record.asctime
        )
    )

configure(JsonFormatter)

app_logger = logging.getLogger('app')

app_logger.info('Example message', dict(string='string', number=1))
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/QuisEgoSum/qstd-logger-json-formatter",
    "name": "qstd-logger-json-formatter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "logging json formatter",
    "author": "QuisEgoSum",
    "author_email": "subbotin.evdokim@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/43/cd/35899372bd50e95175ae80f9edab0d0b55fc7b790c254078c196203fcefc/qstd_logger_json_formatter-0.1.2.tar.gz",
    "platform": null,
    "description": "\n\n# Logging Json Formatter\n\n\n```python\nimport logging\nfrom qstd_logger_json_formatter import JsonFormatter, configure\n\nJsonFormatter\\\n    .set_parse_payload_root_logger('app')\\\n    .set_formatter(\n        'sanic.access',\n        lambda record: dict(\n            level=record.levelname,\n            message=record.message,\n            host=record.host,\n            request=record.request,\n            status=record.status,\n            byte=record.byte,\n            label=record.name,\n            pname=record.processName,\n            pid=record.process,\n            timestamp=record.asctime\n        )\n    )\n\nconfigure(JsonFormatter)\n\napp_logger = logging.getLogger('app')\n\napp_logger.info('Example message', dict(string='string', number=1))\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Logging json formatter",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/QuisEgoSum/qstd-logger-json-formatter"
    },
    "split_keywords": [
        "logging",
        "json",
        "formatter"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "102c9772e99e4c1b0ceca9cbd5435d610a0ed214be64fac23bd391e0d472aaab",
                "md5": "aa43ecaa379fe860bba5e640fc599289",
                "sha256": "ac6e7c44ca5ae948d53e47af0ed9edea165f59a0fe5a347e5e4590a428f17f7b"
            },
            "downloads": -1,
            "filename": "qstd_logger_json_formatter-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aa43ecaa379fe860bba5e640fc599289",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 3619,
            "upload_time": "2024-05-01T10:11:10",
            "upload_time_iso_8601": "2024-05-01T10:11:10.847802Z",
            "url": "https://files.pythonhosted.org/packages/10/2c/9772e99e4c1b0ceca9cbd5435d610a0ed214be64fac23bd391e0d472aaab/qstd_logger_json_formatter-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "43cd35899372bd50e95175ae80f9edab0d0b55fc7b790c254078c196203fcefc",
                "md5": "7dc03c11f92d5885453ade31d27ad9ba",
                "sha256": "a036a541ee1b27fec1f663f1246eb94e142626ac27b9b1f2a72b944953e25970"
            },
            "downloads": -1,
            "filename": "qstd_logger_json_formatter-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "7dc03c11f92d5885453ade31d27ad9ba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 3098,
            "upload_time": "2024-05-01T10:11:13",
            "upload_time_iso_8601": "2024-05-01T10:11:13.868012Z",
            "url": "https://files.pythonhosted.org/packages/43/cd/35899372bd50e95175ae80f9edab0d0b55fc7b790c254078c196203fcefc/qstd_logger_json_formatter-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-01 10:11:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "QuisEgoSum",
    "github_project": "qstd-logger-json-formatter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "qstd-logger-json-formatter"
}
        
Elapsed time: 0.24307s