{"id":29925463,"url":"https://github.com/expressapp/pybotx-smartapp-smart-logger","last_synced_at":"2025-10-13T07:16:09.088Z","repository":{"id":38296892,"uuid":"473645590","full_name":"ExpressApp/pybotx-smartapp-smart-logger","owner":"ExpressApp","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-19T01:29:48.000Z","size":88,"stargazers_count":0,"open_issues_count":14,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-19T03:34:31.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ExpressApp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-24T14:39:54.000Z","updated_at":"2022-03-24T14:48:47.000Z","dependencies_parsed_at":"2023-12-14T21:26:56.560Z","dependency_job_id":"857d7b0d-74c3-43ac-b519-b4c57e7f550f","html_url":"https://github.com/ExpressApp/pybotx-smartapp-smart-logger","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ExpressApp/pybotx-smartapp-smart-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpressApp%2Fpybotx-smartapp-smart-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpressApp%2Fpybotx-smartapp-smart-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpressApp%2Fpybotx-smartapp-smart-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpressApp%2Fpybotx-smartapp-smart-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ExpressApp","download_url":"https://codeload.github.com/ExpressApp/pybotx-smartapp-smart-logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpressApp%2Fpybotx-smartapp-smart-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279014113,"owners_count":26085462,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-08-02T11:37:10.138Z","updated_at":"2025-10-13T07:16:09.071Z","avatar_url":"https://github.com/ExpressApp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pybotx-smartapp-smart-logger\n\n## Интеграция [pybotx-smart-logger](https://github.com/ExpressApp/pybotx-smart-logger) и [pybotx-smartapp-rpc](https://github.com/ExpressApp/pybotx-smartapp-rpc)\n\n## Установка и использование\n\n1. Устанавливаем библиотеку:  \n```bash\npoetry add pybotx-smartapp-smart-logger\n```\n\n2. Подключаем `pybotx-smart-logger` по инструкции из [README](https://github.com/ExpressApp/pybotx-smart-logger/blob/master/README.md)\n\n3. Подключаем `pybotx-smartapp-rpc` по инструкции из [README](https://github.com/ExpressApp/pybotx-smartapp-rpc/blob/master/README.md)\n\n4. Подключаем хендлер исключений к смартапу\n\n```python\nfrom pybotx_smartapp_smart_logger import smartapp_exception_handler\n\nsmartapp = SmartAppRPC(\n    routers=...,\n    exception_handlers={Exception: smartapp_exception_handler}\n)\n```\n\n5. Оборачиваем вызов `handle_smartapp_event` в контекстный менеджер:\n\n```python\nfrom pybotx_smart_logger import wrap_system_event\n\n@collector.smartapp_event\nasync def handle_smartapp_event(event: SmartAppEvent, bot: Bot) -\u003e None:\n    with wrap_system_event(event, settings.DEBUG):\n        await smartapp.handle_smartapp_event(event, bot)\n```\n\n## Гдe применять\n\nДобавлять логи лучше везде, где информация из них поможет при диагностике ошибки. Например, здесь выводятся аргументы перед выполением деления.\n\n```python\nfrom pybotx_smart_logger import smart_log\n\n@rpc.method(\"divide\")\nasync def divide(\n    smartapp: SmartApp, rpc_arguments: SumArgs\n) -\u003e RPCResultResponse[int]:\n    smart_log(f\"RPC method `divide` called with args: {rpc_arguments}\")\n    return RPCResultResponse(result=rpc_arguments.a / rpc_arguments.b)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpressapp%2Fpybotx-smartapp-smart-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexpressapp%2Fpybotx-smartapp-smart-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexpressapp%2Fpybotx-smartapp-smart-logger/lists"}