{"id":16206920,"url":"https://github.com/sgykfjsm/flask-logging-decorator","last_synced_at":"2025-03-19T07:31:36.626Z","repository":{"id":52704769,"uuid":"133889024","full_name":"sgykfjsm/flask-logging-decorator","owner":"sgykfjsm","description":"a deadly simple logging decorator for Flask","archived":false,"fork":false,"pushed_at":"2021-04-20T17:28:20.000Z","size":32,"stargazers_count":5,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T16:41:12.420Z","etag":null,"topics":["decorator","flask","logging","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sgykfjsm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-18T01:51:12.000Z","updated_at":"2019-10-25T15:08:20.000Z","dependencies_parsed_at":"2022-08-26T05:01:54.587Z","dependency_job_id":null,"html_url":"https://github.com/sgykfjsm/flask-logging-decorator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgykfjsm%2Fflask-logging-decorator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgykfjsm%2Fflask-logging-decorator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgykfjsm%2Fflask-logging-decorator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgykfjsm%2Fflask-logging-decorator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgykfjsm","download_url":"https://codeload.github.com/sgykfjsm/flask-logging-decorator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243976644,"owners_count":20377695,"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":["decorator","flask","logging","python"],"created_at":"2024-10-10T10:08:45.609Z","updated_at":"2025-03-19T07:31:36.331Z","avatar_url":"https://github.com/sgykfjsm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flask-logging-decorator\n\n[![Build Status](https://travis-ci.org/sgykfjsm/flask-logging-decorator.svg?branch=master)](https://travis-ci.org/sgykfjsm/flask-logging-decorator)\n\nThis is a deadly simple logging decorator for Flask. This is highly inspired by [canassa/flask-trace](https://github.com/canassa/flask-trace).\n\n## Compatibility\n\nThis is tested with Python3.5, 3.6 and Flask1.0.2.\n\n## Installation\n\n```bash\npip install flask-logging-decorator\n```\n\n## Run the test\n\nThis modules uses [pytest](http://pytest.org/latest/). You can install it before running the test.\n\n```bash\npython -m pytest -v\n```\n\n## Usage\n\nImport and put it as the decorator function.\n\n```python\nimport logging\n\nfrom flask_logging_decorator import trace\nfrom flask import Flask\n\napp = Flask(__name__)\n\n@trace(logging.ERROR)\n@app.route('/')\ndef index():\n    return 'hello'\n\n...\n```\n\nThe application should show the logging message like following.\n\n```text\n[2018-05-17 19:01:31,468] ERROR in __init__: trace_uuid=cf66d343-06f4-49cb-a680-59ba9ec77570 method=GET func_name=index func_args: query_args:foo='bar' baz='qux' post_values: trace_info:trace_pathname=main.py trace_lineno=12\n```\n\nIf you don't pass the logging level to `@trace`, it will use the Flask's application logger.\n\n## License\n\nMIT license, see the LICENSE file. You can use this library in open source projects and commercial products.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgykfjsm%2Fflask-logging-decorator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgykfjsm%2Fflask-logging-decorator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgykfjsm%2Fflask-logging-decorator/lists"}