{"id":27392357,"url":"https://github.com/easydevv/pyhunt","last_synced_at":"2026-02-21T17:01:32.268Z","repository":{"id":287488195,"uuid":"964914573","full_name":"EasyDevv/pyhunt","owner":"EasyDevv","description":"Lightweight Python logging tool for visual call tracing, tree-structured colored logs, and easy debugging with a simple decorator. Optimized for both standard and AI-generated codebases.","archived":false,"fork":false,"pushed_at":"2025-09-11T16:14:00.000Z","size":167,"stargazers_count":44,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-13T19:22:55.314Z","etag":null,"topics":["ai","colored-log","debug","decorator","developer-tool","logging","stacktrace","terminal","trace","tree-structure"],"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/EasyDevv.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}},"created_at":"2025-04-12T02:50:26.000Z","updated_at":"2025-09-11T22:16:37.000Z","dependencies_parsed_at":"2025-06-25T19:44:34.674Z","dependency_job_id":null,"html_url":"https://github.com/EasyDevv/pyhunt","commit_stats":null,"previous_names":["easydevv/pyhunt"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/EasyDevv/pyhunt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyDevv%2Fpyhunt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyDevv%2Fpyhunt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyDevv%2Fpyhunt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyDevv%2Fpyhunt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EasyDevv","download_url":"https://codeload.github.com/EasyDevv/pyhunt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EasyDevv%2Fpyhunt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29688216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ai","colored-log","debug","decorator","developer-tool","logging","stacktrace","terminal","trace","tree-structure"],"created_at":"2025-04-13T21:18:56.084Z","updated_at":"2026-02-21T17:01:32.257Z","avatar_url":"https://github.com/EasyDevv.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"docs/logo.png\" alt=\"pyhunt_logo\" width=\"200\"/\u003e\n\n# pyhunt\n\n`pyhunt` is a lightweight logging tool that visually represents logs for quick structural understanding and debugging.  \nSimply add a decorator to your functions, and all logs are automatically traced and displayed in your terminal.\n\n[![PyPI version](https://img.shields.io/pypi/v/pyhunt.svg)](https://pypi.org/project/pyhunt/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/pyhunt.svg)](https://pypi.org/project/pyhunt/)\n\n#### English | [한국어](/README_KR.md)\n\n---\n\nhttps://github.com/user-attachments/assets/3d4389fe-4708-423a-812e-25f2e7200053\n\n\u003cimg src=\"docs/description.png\" alt=\"pyhunt_description\" width=\"600\"/\u003e\n\n\u003c/div\u003e\n\n## Features\n\n- **Automatic Function/Method Call Tracing**: Automatically records the flow of synchronous/asynchronous functions and classes with a single `@trace` decorator.\n- **Rich Colors and Tree-Structured Logs**: Enhances readability with color and indentation based on call depth.\n- **Multiple Log Levels Supported**: DEBUG, INFO, WARNING, ERROR, CRITICAL.\n- **Set Log Level via CLI**: Manage and store `HUNT_LEVEL` in a `.env` file.\n- **Optimized for AI Workflows**: Easily trace code generated by AI.\n- **Detailed Exception Information**: Includes call arguments, location, and stack trace on exceptions.\n\n## Installation\n\n### Install with pip\n```bash\npip install pyhunt\n```\n\n### Install with uv\n```bash\nuv add pyhunt\n```\n\n## Quick Start\n\n### 1. Set Up and Manage Environment Variable File\nYou can set up and manage the `.env` file by running the `hunt` command.\n\n```bash\nhunt\n```\n\nExecuting the above command sets `HUNT_LEVEL=DEBUG` and `ROOT_DIR` to the current directory in the `.env` file.\n\n### 2. Apply `@trace` to Functions or Classes\nSee more examples in the [examples](https://github.com/pyhunt/pyhunt/tree/main/examples) folder.\n\n#### Basic Example\n```py\nfrom pyhunt import trace\n\n@trace\ndef test(value):\n    return value\n```\n\n#### Asynchronous Function\n```py\n@trace\nasync def test(value):\n    return value\n```\n\n#### Class\n```py\n@trace\nclass MyClass:\n    def first_method(self, value):\n        return value\n\n    def second_method(self, value):\n        return value\n```\n\n## Using with AI\n\n### Rule Setup\nAdd the following rules to `AGENTS.md` or `CLAUDE.md`:\n\n```md\n## Logging Rules\n\n**Import:** Import the decorator with `from pyhunt import trace`.\n**Tracing:** Use the `@trace` decorator to automatically log function calls and execution times.\n**Avoid `print()`:** Do not use the `print()` function.\n**Exception Handling:** Use `try`/`except Exception as e: raise e` blocks to maintain traceback.\n```\n\n### Modifying Existing Codebase\nPrompt: **\"Modify the code according to the logging rules.\"**\n\n## Logger Usage\n\nThe `logger` interface is recommended for use only in important sections.  \nMost actions are traced via `@trace`, and excessive use may reduce readability.\n\n```py\nfrom pyhunt import logger\n\nlogger.debug(\"This is a debug log.\")\nlogger.info(\"This is an info log.\")\nlogger.warning(\"This is a warning log.\")\nlogger.error(\"This is an error log.\")\nlogger.critical(\"This is a critical log.\")\n```\n\n## CLI Usage\n\nYou can manage log levels and other settings using the `hunt` command.\n\n```bash\nhunt [options]\n```\n\n### Supported Options\n\n- `--debug`, `--info`, `--warning`, `--error`, `--critical` : Set log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)\n  ```bash\n  hunt --debug    # Most detailed logs\n  hunt --info     # Information logs\n  hunt --warning  # Warning logs\n  hunt --error    # Error logs\n  hunt --critical # Critical logs only\n  ```\n\n- `--root` : Sets the `ROOT_DIR` environment variable to the current directory.\n  ```bash\n  hunt --root\n  ```\n\n- `--repeat \u003ccount\u003e` : Sets the `HUNT_MAX_REPEAT` environment variable to the specified count. (Log repetition limit)\n  ```bash\n  hunt --repeat 5\n  ```\n\n- `--color \u003ctrue|false\u003e` : Enable or disable color output in logs.\n  ```bash\n  hunt --color false\n  ```\n\n- `--log-file \u003cfile\u003e` : Set log file output. If no file is specified, defaults to `.pyhunt.log`.\n  ```bash\n  hunt --log-file\n  ```\n\nIf no option is specified, the default is `DEBUG`.\n\n### Environment Variables\n\n`pyhunt` supports the following environment variables through the `.env` file:\n\n- `HUNT_LEVEL`: Sets the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL). Default is `DEBUG`.\n- `HUNT_MAX_REPEAT`: The number of times the same log is displayed when repeated. Default is 3.\n- `ELAPSED`: Sets whether to display function execution time in logs (`True` or `False`). Default is `True`.\n- `HUNT_COLOR`: Sets whether to enable color output (`True` or `False`). Default is `True`.\n- `HUNT_LOG_FILE`: Sets the file path for log output. If not specified, logs are only displayed in the terminal.\n- `ROOT_DIR`: Sets the base directory for log output. Displays paths more accurately.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasydevv%2Fpyhunt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasydevv%2Fpyhunt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasydevv%2Fpyhunt/lists"}