
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
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.
pyhunt
is a lightweight logging tool that visually represents logs for quick structural understanding and debugging.
Simply add a decorator to your functions, and all logs are automatically traced and displayed in your terminal.
https://github.com/user-attachments/assets/3d4389fe-4708-423a-812e-25f2e7200053
@trace
decorator.HUNT_LEVEL
in a .env
file.pip install pyhunt
uv add pyhunt
You can set up and manage the .env
file by running the hunt
command.
hunt
Executing the above command sets HUNT_LEVEL=DEBUG
and ROOT_DIR
to the current directory in the .env
file.
@trace
to Functions or ClassesSee more examples in the examples folder.
from pyhunt import trace
@trace
def test(value):
return value
@trace
async def test(value):
return value
@trace
class MyClass:
def first_method(self, value):
return value
def second_method(self, value):
return value
Add the following rules to .cursorrules
, .clinerules
, or .roorules
:
<logging-rules>
**Import:** Import the decorator with `from pyhunt import trace`.
**Tracing:** Use the `@trace` decorator to automatically log function calls and execution times.
**Avoid `print()`:** Do not use the `print()` function.
**Exception Handling:** Use `try`/`except Exception as e: raise e` blocks to maintain traceback.
</logging-rules>
Prompt: "Modify the code according to the logging rules."
The logger
interface is recommended for use only in important sections.
Most actions are traced via @trace
, and excessive use may reduce readability.
from pyhunt import logger
logger.debug("This is a debug log.")
logger.info("This is an info log.")
logger.warning("This is a warning log.")
logger.error("This is an error log.")
logger.critical("This is a critical log.")
You can manage log levels and other settings using the hunt
command.
hunt [options]
--debug
: DEBUG level (most detailed)--info
: INFO level--warning
: WARNING level--error
: ERROR level--critical
: CRITICAL level--root
: Sets the ROOT_DIR
environment variable to the current directory.--repeat <count>
: Sets the HUNT_MAX_REPEAT
environment variable to the specified count. (Log repetition limit)If no option is specified, the default is DEBUG
.
pyhunt
supports the following environment variables through the .env
file:
HUNT_LEVEL
: Sets the log level (DEBUG, INFO, WARNING, ERROR, CRITICAL). Default is DEBUG
.HUNT_MAX_REPEAT
: The number of times the same log is displayed when repeated. Default is 3.ELAPSED
: Sets whether to display function execution time in logs (True
or False
). Default is True
.ROOT_DIR
: Sets the base directory for log output. Displays paths more accurately.FAQs
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.
We found that pyhunt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.