# HuntGlitch Python Logger
A Python package for sending exception logs and custom messages to the HuntGlitch Lighthouse API. This package provides an easy way to integrate error tracking and logging into your Python applications.
## 📦 Installation
### Option 1: Install from PyPI
```bash
pip install huntglitch-python
```
### Option 2: Install from source
```bash
# Clone the repository
git clone https://github.com/huntglitch-npm/huntglitch-python.git
cd huntglitch-python
# Install the package
pip install .
```
### Option 3: Install from GitHub
```bash
pip install git+https://github.com/huntglitch-npm/huntglitch-python.git
```
## ⚙️ Configuration
The package supports multiple ways to configure your project credentials:
### 1. Environment Variables (Recommended)
Create a `.env` file in your project root:
```env
PROJECT_KEY=your-project-key
DELIVERABLE_KEY=your-deliverable-key
```
Alternative variable names (the library checks both):
```env
HUNTGLITCH_PROJECT_KEY=your-project-key
HUNTGLITCH_DELIVERABLE_KEY=your-deliverable-key
```
### 2. Explicit Configuration
```python
from huntglitch_python import HuntGlitchLogger
logger = HuntGlitchLogger(
project_key="your-project-key",
deliverable_key="your-deliverable-key"
)
```
### 3. Environment Variable Locations
The package automatically searches for `.env` files in these locations:
- Current working directory (`./env`)
- Project root (`./env.local`)
- Home directory (`~/.huntglitch.env`)
If you don't have project and deliverable keys, you can get them after creating a new project and deliverable in your HuntGlitch dashboard.
### 4. Production Configuration
For production environments, set environment variables directly:
```bash
export PROJECT_KEY=your-project-key
export DELIVERABLE_KEY=your-deliverable-key
```
Or in Docker:
```dockerfile
ENV PROJECT_KEY=your-project-key
ENV DELIVERABLE_KEY=your-deliverable-key
```
## 🚀 Usage
### Method 1: Class-based API (Recommended for Production)
```python
from huntglitch_python import HuntGlitchLogger
# Initialize with configuration
logger = HuntGlitchLogger(
project_key="your-project-key", # Optional if env var is set
deliverable_key="your-deliverable-key", # Optional if env var is set
timeout=10, # Request timeout
retries=3, # Number of retries on failure
silent_failures=True # Don't raise on API errors
)
def example_function():
try:
# Your code that might raise an exception
result = 100 / 0
except Exception:
# Capture and report the exception
success = logger.capture_exception(
additional_data={"user_id": 123, "feature": "calculation"}
)
if success:
print("Error logged successfully")
example_function()
```
### Method 2: Simple Function API (Backward Compatible)
```python
from huntglitch_python import capture_exception_and_report
def example_function():
try:
# Your code that might raise an exception
result = 100 / 0
except Exception:
# Capture and report the exception
capture_exception_and_report()
example_function()
```
### Manual Exception Logging
```python
from huntglitch_python.logger import send_huntglitch_log
try:
# Your code here
risky_operation()
except Exception as e:
send_huntglitch_log(
error_name=type(e).__name__,
error_value=str(e),
file_name=__file__,
line_number=42, # Line where error occurred
log_type=5, # Error type
additional_data={"user_id": 123, "action": "risky_operation"}
)
```
### Using with Additional Data
```python
from huntglitch_python.logger import capture_exception_and_report
def process_user_order(user_id, order_id):
try:
# Process order logic
process_order(order_id)
except Exception:
# Report with additional context
capture_exception_and_report(
additional_data={
"user_data": {
"user_id": user_id,
"name": "John Doe"
},
"order_data": {
"order_id": order_id,
"status": "processing"
}
},
tags={"module": "order_processing", "severity": "high"},
ip_address="192.168.1.100"
)
```
### Global Exception Handler
For Flask applications:
```python
from flask import Flask, request
from huntglitch_python.logger import capture_exception_and_report
app = Flask(__name__)
@app.errorhandler(Exception)
def handle_exception(e):
# Log the exception to HuntGlitch
capture_exception_and_report(
additional_data={"request_url": request.url, "method": request.method}
)
# Return error response
return "Internal Server Error", 500
```
For Django applications (in settings.py):
```python
# Add to your Django settings
import sys
from huntglitch_python.logger import capture_exception_and_report
def custom_exception_handler(exc_type, exc_value, exc_traceback):
# Log to HuntGlitch
sys.__excepthook__(exc_type, exc_value, exc_traceback)
capture_exception_and_report()
sys.excepthook = custom_exception_handler
```
## 📋 API Reference
### `send_huntglitch_log()`
Send a custom log entry to HuntGlitch.
**Parameters:**
- `error_name` (str, required): Name of the error/exception
- `error_value` (str, required): Error message or value
- `file_name` (str, required): File where the error occurred
- `line_number` (int, required): Line number where the error occurred
- `error_code` (int, optional): Custom error code (default: 0)
- `log_type` (int, optional): Log type (1=debug, 2=info, 3=notice, 4=warning, 5=error) (default: 5)
- `ip_address` (str, optional): IP address (default: "0.0.0.0")
- `additional_data` (dict, optional): Additional context data
- `tags` (dict, optional): Tags for categorization
- `request_headers` (dict, optional): HTTP request headers
- `request_body` (dict, optional): HTTP request body
- `request_url` (str, optional): Request URL
- `request_method` (str, optional): HTTP method (default: "GET")
### `capture_exception_and_report()`
Automatically capture the current exception and report it to HuntGlitch.
**Parameters:**
- `**kwargs`: Any additional parameters supported by `send_huntglitch_log()`
## 🔧 Log Types
| Type | Value | Description |
|------|-------|-------------|
| Debug | 1 | Debug information |
| Info | 2 | Informational messages |
| Notice | 3 | Normal but significant conditions |
| Warning | 4 | Warning conditions |
| Error | 5 | Error conditions (default) |
You can use either string or integer values:
```python
logger.send_log(..., log_type="warning") # String
logger.send_log(..., log_type=4) # Integer
```
## 🛡️ Production-Ready Features
### Retry Logic with Exponential Backoff
The logger automatically retries failed requests with exponential backoff:
```python
logger = HuntGlitchLogger(
retries=3, # Number of retry attempts
retry_delay=1.0, # Base delay between retries
timeout=10 # Request timeout
)
```
### Silent Failure Mode
In production, you may want to continue execution even if logging fails:
```python
logger = HuntGlitchLogger(
silent_failures=True # Log errors instead of raising exceptions
)
# Returns True/False instead of raising exceptions
success = logger.capture_exception()
```
### Configuration Validation
The package validates configuration on initialization:
```python
try:
logger = HuntGlitchLogger() # Will raise ConfigurationError if keys missing
except ConfigurationError as e:
print(f"Configuration error: {e}")
```
### Error Handling
Custom exceptions for different error types:
```python
from huntglitch_python import ConfigurationError, APIError, HuntGlitchError
try:
logger = HuntGlitchLogger(silent_failures=False)
logger.send_log(...)
except ConfigurationError:
print("Missing or invalid configuration")
except APIError:
print("API request failed")
except HuntGlitchError:
print("Other HuntGlitch error")
```
## 🌐 Framework Integration Examples
### FastAPI
```python
from fastapi import FastAPI, HTTPException, Request
from huntglitch_python.logger import capture_exception_and_report
app = FastAPI()
@app.exception_handler(Exception)
async def global_exception_handler(request: Request, exc: Exception):
capture_exception_and_report(
additional_data={
"request_url": str(request.url),
"method": request.method,
"headers": dict(request.headers)
}
)
raise HTTPException(status_code=500, detail="Internal server error")
```
### Celery Tasks
```python
from celery import Celery
from huntglitch_python.logger import capture_exception_and_report
app = Celery('tasks')
@app.task(bind=True)
def process_data(self, data):
try:
# Process data
return process_complex_data(data)
except Exception:
capture_exception_and_report(
additional_data={
"task_id": self.request.id,
"task_name": "process_data",
"input_data": data
}
)
raise
```
### Asyncio Applications
```python
import asyncio
from huntglitch_python.logger import capture_exception_and_report
async def async_process():
try:
# Async operations
await some_async_operation()
except Exception:
capture_exception_and_report(
additional_data={"operation": "async_process"}
)
raise
# For global async exception handling
def handle_exception(loop, context):
exception = context.get('exception')
if exception:
capture_exception_and_report(
additional_data={"context": str(context)}
)
loop = asyncio.get_event_loop()
loop.set_exception_handler(handle_exception)
```
## 🔄 Alternative Usage Methods
### As a Decorator
You can create a decorator for automatic error reporting:
```python
import functools
from huntglitch_python.logger import capture_exception_and_report
def log_exceptions(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except Exception:
capture_exception_and_report(
additional_data={
"function": func.__name__,
"args": str(args),
"kwargs": str(kwargs)
}
)
raise
return wrapper
# Usage
@log_exceptions
def risky_function():
# Your code here
pass
```
### Context Manager
```python
from contextlib import contextmanager
from huntglitch_python.logger import capture_exception_and_report
@contextmanager
def error_reporting(operation_name):
try:
yield
except Exception:
capture_exception_and_report(
additional_data={"operation": operation_name}
)
raise
# Usage
with error_reporting("database_operation"):
# Your database code here
pass
```
## 🛠️ Development
### Running Tests
```bash
# Install development dependencies
pip install -r requirements.txt
# Run tests
python -m pytest tests/
```
### Project Structure
```
huntglitch-python/
├── huntglitch_python/
│ ├── __init__.py
│ └── logger.py
├── tests/
│ └── test_logger.py
├── requirements.txt
├── setup.py
├── pyproject.toml
└── README.md
```
### Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
## 🔍 Troubleshooting
### Common Issues
1. **Missing Environment Variables**: Ensure `PROJECT_KEY` and `DELIVERABLE_KEY` are set
2. **Network Issues**: Check if the API endpoint is accessible
3. **Import Errors**: Verify the package is properly installed
### Debug Mode
For debugging, you can catch and print any errors from the logging itself:
```python
from huntglitch_python.logger import send_huntglitch_log
try:
# Your code
pass
except Exception as e:
try:
send_huntglitch_log(
error_name=type(e).__name__,
error_value=str(e),
file_name=__file__,
line_number=10
)
except Exception as log_error:
print(f"Failed to log to HuntGlitch: {log_error}")
```
## 📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
## 🤝 Support
For support, email support@huntglitch.com or create an issue in this repository.
Raw data
{
"_id": null,
"home_page": "https://github.com/huntglitch-npm/huntglitch-python",
"name": "huntglitch-python",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "HuntGlitch <support@huntglitch.com>",
"keywords": "logging, error tracking, monitoring, debugging, huntglitch",
"author": "HuntGlitch",
"author_email": "HuntGlitch <support@huntglitch.com>",
"download_url": "https://files.pythonhosted.org/packages/df/47/8bf06b9a68568f3783da2287cdff81d1a6d1bc7144d3117223ab691af6cf/huntglitch_python-1.1.0.tar.gz",
"platform": null,
"description": "# HuntGlitch Python Logger\r\n\r\nA Python package for sending exception logs and custom messages to the HuntGlitch Lighthouse API. This package provides an easy way to integrate error tracking and logging into your Python applications.\r\n\r\n## \ud83d\udce6 Installation\r\n\r\n### Option 1: Install from PyPI\r\n```bash\r\npip install huntglitch-python\r\n```\r\n\r\n### Option 2: Install from source\r\n```bash\r\n# Clone the repository\r\ngit clone https://github.com/huntglitch-npm/huntglitch-python.git\r\ncd huntglitch-python\r\n\r\n# Install the package\r\npip install .\r\n```\r\n\r\n### Option 3: Install from GitHub\r\n```bash\r\npip install git+https://github.com/huntglitch-npm/huntglitch-python.git\r\n```\r\n\r\n## \u2699\ufe0f Configuration\r\n\r\nThe package supports multiple ways to configure your project credentials:\r\n\r\n### 1. Environment Variables (Recommended)\r\n\r\nCreate a `.env` file in your project root:\r\n\r\n```env\r\nPROJECT_KEY=your-project-key\r\nDELIVERABLE_KEY=your-deliverable-key\r\n```\r\n\r\nAlternative variable names (the library checks both):\r\n```env\r\nHUNTGLITCH_PROJECT_KEY=your-project-key\r\nHUNTGLITCH_DELIVERABLE_KEY=your-deliverable-key\r\n```\r\n\r\n### 2. Explicit Configuration\r\n\r\n```python\r\nfrom huntglitch_python import HuntGlitchLogger\r\n\r\nlogger = HuntGlitchLogger(\r\n project_key=\"your-project-key\",\r\n deliverable_key=\"your-deliverable-key\"\r\n)\r\n```\r\n\r\n### 3. Environment Variable Locations\r\n\r\nThe package automatically searches for `.env` files in these locations:\r\n- Current working directory (`./env`)\r\n- Project root (`./env.local`)\r\n- Home directory (`~/.huntglitch.env`)\r\n\r\nIf you don't have project and deliverable keys, you can get them after creating a new project and deliverable in your HuntGlitch dashboard.\r\n\r\n### 4. Production Configuration\r\n\r\nFor production environments, set environment variables directly:\r\n\r\n```bash\r\nexport PROJECT_KEY=your-project-key\r\nexport DELIVERABLE_KEY=your-deliverable-key\r\n```\r\n\r\nOr in Docker:\r\n```dockerfile\r\nENV PROJECT_KEY=your-project-key\r\nENV DELIVERABLE_KEY=your-deliverable-key\r\n```\r\n\r\n## \ud83d\ude80 Usage\r\n\r\n### Method 1: Class-based API (Recommended for Production)\r\n\r\n```python\r\nfrom huntglitch_python import HuntGlitchLogger\r\n\r\n# Initialize with configuration\r\nlogger = HuntGlitchLogger(\r\n project_key=\"your-project-key\", # Optional if env var is set\r\n deliverable_key=\"your-deliverable-key\", # Optional if env var is set\r\n timeout=10, # Request timeout\r\n retries=3, # Number of retries on failure\r\n silent_failures=True # Don't raise on API errors\r\n)\r\n\r\ndef example_function():\r\n try:\r\n # Your code that might raise an exception\r\n result = 100 / 0\r\n except Exception:\r\n # Capture and report the exception\r\n success = logger.capture_exception(\r\n additional_data={\"user_id\": 123, \"feature\": \"calculation\"}\r\n )\r\n if success:\r\n print(\"Error logged successfully\")\r\n\r\n\r\nexample_function()\r\n```\r\n\r\n### Method 2: Simple Function API (Backward Compatible)\r\n\r\n```python\r\nfrom huntglitch_python import capture_exception_and_report\r\n\r\ndef example_function():\r\n try:\r\n # Your code that might raise an exception\r\n result = 100 / 0\r\n except Exception:\r\n # Capture and report the exception\r\n capture_exception_and_report()\r\n\r\n\r\nexample_function()\r\n```\r\n\r\n### Manual Exception Logging\r\n\r\n```python\r\nfrom huntglitch_python.logger import send_huntglitch_log\r\n\r\ntry:\r\n # Your code here\r\n risky_operation()\r\nexcept Exception as e:\r\n send_huntglitch_log(\r\n error_name=type(e).__name__,\r\n error_value=str(e),\r\n file_name=__file__,\r\n line_number=42, # Line where error occurred\r\n log_type=5, # Error type\r\n additional_data={\"user_id\": 123, \"action\": \"risky_operation\"}\r\n )\r\n```\r\n\r\n### Using with Additional Data\r\n\r\n```python\r\nfrom huntglitch_python.logger import capture_exception_and_report\r\n\r\ndef process_user_order(user_id, order_id):\r\n try:\r\n # Process order logic\r\n process_order(order_id)\r\n except Exception:\r\n # Report with additional context\r\n capture_exception_and_report(\r\n additional_data={\r\n \"user_data\": {\r\n \"user_id\": user_id,\r\n \"name\": \"John Doe\"\r\n },\r\n \"order_data\": {\r\n \"order_id\": order_id,\r\n \"status\": \"processing\"\r\n }\r\n },\r\n tags={\"module\": \"order_processing\", \"severity\": \"high\"},\r\n ip_address=\"192.168.1.100\"\r\n )\r\n```\r\n\r\n### Global Exception Handler\r\n\r\nFor Flask applications:\r\n\r\n```python\r\nfrom flask import Flask, request\r\nfrom huntglitch_python.logger import capture_exception_and_report\r\n\r\napp = Flask(__name__)\r\n\r\n@app.errorhandler(Exception)\r\ndef handle_exception(e):\r\n # Log the exception to HuntGlitch\r\n capture_exception_and_report(\r\n additional_data={\"request_url\": request.url, \"method\": request.method}\r\n )\r\n # Return error response\r\n return \"Internal Server Error\", 500\r\n```\r\n\r\nFor Django applications (in settings.py):\r\n\r\n```python\r\n# Add to your Django settings\r\nimport sys\r\nfrom huntglitch_python.logger import capture_exception_and_report\r\n\r\ndef custom_exception_handler(exc_type, exc_value, exc_traceback):\r\n # Log to HuntGlitch\r\n sys.__excepthook__(exc_type, exc_value, exc_traceback)\r\n capture_exception_and_report()\r\n\r\nsys.excepthook = custom_exception_handler\r\n```\r\n\r\n## \ud83d\udccb API Reference\r\n\r\n### `send_huntglitch_log()`\r\n\r\nSend a custom log entry to HuntGlitch.\r\n\r\n**Parameters:**\r\n- `error_name` (str, required): Name of the error/exception\r\n- `error_value` (str, required): Error message or value\r\n- `file_name` (str, required): File where the error occurred\r\n- `line_number` (int, required): Line number where the error occurred\r\n- `error_code` (int, optional): Custom error code (default: 0)\r\n- `log_type` (int, optional): Log type (1=debug, 2=info, 3=notice, 4=warning, 5=error) (default: 5)\r\n- `ip_address` (str, optional): IP address (default: \"0.0.0.0\")\r\n- `additional_data` (dict, optional): Additional context data\r\n- `tags` (dict, optional): Tags for categorization\r\n- `request_headers` (dict, optional): HTTP request headers\r\n- `request_body` (dict, optional): HTTP request body\r\n- `request_url` (str, optional): Request URL\r\n- `request_method` (str, optional): HTTP method (default: \"GET\")\r\n\r\n### `capture_exception_and_report()`\r\n\r\nAutomatically capture the current exception and report it to HuntGlitch.\r\n\r\n**Parameters:**\r\n- `**kwargs`: Any additional parameters supported by `send_huntglitch_log()`\r\n\r\n## \ud83d\udd27 Log Types\r\n\r\n| Type | Value | Description |\r\n|------|-------|-------------|\r\n| Debug | 1 | Debug information |\r\n| Info | 2 | Informational messages |\r\n| Notice | 3 | Normal but significant conditions |\r\n| Warning | 4 | Warning conditions |\r\n| Error | 5 | Error conditions (default) |\r\n\r\nYou can use either string or integer values:\r\n\r\n```python\r\nlogger.send_log(..., log_type=\"warning\") # String\r\nlogger.send_log(..., log_type=4) # Integer\r\n```\r\n\r\n## \ud83d\udee1\ufe0f Production-Ready Features\r\n\r\n### Retry Logic with Exponential Backoff\r\nThe logger automatically retries failed requests with exponential backoff:\r\n\r\n```python\r\nlogger = HuntGlitchLogger(\r\n retries=3, # Number of retry attempts\r\n retry_delay=1.0, # Base delay between retries\r\n timeout=10 # Request timeout\r\n)\r\n```\r\n\r\n### Silent Failure Mode\r\nIn production, you may want to continue execution even if logging fails:\r\n\r\n```python\r\nlogger = HuntGlitchLogger(\r\n silent_failures=True # Log errors instead of raising exceptions\r\n)\r\n\r\n# Returns True/False instead of raising exceptions\r\nsuccess = logger.capture_exception()\r\n```\r\n\r\n### Configuration Validation\r\nThe package validates configuration on initialization:\r\n\r\n```python\r\ntry:\r\n logger = HuntGlitchLogger() # Will raise ConfigurationError if keys missing\r\nexcept ConfigurationError as e:\r\n print(f\"Configuration error: {e}\")\r\n```\r\n\r\n### Error Handling\r\nCustom exceptions for different error types:\r\n\r\n```python\r\nfrom huntglitch_python import ConfigurationError, APIError, HuntGlitchError\r\n\r\ntry:\r\n logger = HuntGlitchLogger(silent_failures=False)\r\n logger.send_log(...)\r\nexcept ConfigurationError:\r\n print(\"Missing or invalid configuration\")\r\nexcept APIError:\r\n print(\"API request failed\")\r\nexcept HuntGlitchError:\r\n print(\"Other HuntGlitch error\")\r\n```\r\n\r\n## \ud83c\udf10 Framework Integration Examples\r\n\r\n### FastAPI\r\n\r\n```python\r\nfrom fastapi import FastAPI, HTTPException, Request\r\nfrom huntglitch_python.logger import capture_exception_and_report\r\n\r\napp = FastAPI()\r\n\r\n@app.exception_handler(Exception)\r\nasync def global_exception_handler(request: Request, exc: Exception):\r\n capture_exception_and_report(\r\n additional_data={\r\n \"request_url\": str(request.url),\r\n \"method\": request.method,\r\n \"headers\": dict(request.headers)\r\n }\r\n )\r\n raise HTTPException(status_code=500, detail=\"Internal server error\")\r\n```\r\n\r\n### Celery Tasks\r\n\r\n```python\r\nfrom celery import Celery\r\nfrom huntglitch_python.logger import capture_exception_and_report\r\n\r\napp = Celery('tasks')\r\n\r\n@app.task(bind=True)\r\ndef process_data(self, data):\r\n try:\r\n # Process data\r\n return process_complex_data(data)\r\n except Exception:\r\n capture_exception_and_report(\r\n additional_data={\r\n \"task_id\": self.request.id,\r\n \"task_name\": \"process_data\",\r\n \"input_data\": data\r\n }\r\n )\r\n raise\r\n```\r\n\r\n### Asyncio Applications\r\n\r\n```python\r\nimport asyncio\r\nfrom huntglitch_python.logger import capture_exception_and_report\r\n\r\nasync def async_process():\r\n try:\r\n # Async operations\r\n await some_async_operation()\r\n except Exception:\r\n capture_exception_and_report(\r\n additional_data={\"operation\": \"async_process\"}\r\n )\r\n raise\r\n\r\n# For global async exception handling\r\ndef handle_exception(loop, context):\r\n exception = context.get('exception')\r\n if exception:\r\n capture_exception_and_report(\r\n additional_data={\"context\": str(context)}\r\n )\r\n\r\nloop = asyncio.get_event_loop()\r\nloop.set_exception_handler(handle_exception)\r\n```\r\n\r\n## \ud83d\udd04 Alternative Usage Methods\r\n\r\n### As a Decorator\r\n\r\nYou can create a decorator for automatic error reporting:\r\n\r\n```python\r\nimport functools\r\nfrom huntglitch_python.logger import capture_exception_and_report\r\n\r\ndef log_exceptions(func):\r\n @functools.wraps(func)\r\n def wrapper(*args, **kwargs):\r\n try:\r\n return func(*args, **kwargs)\r\n except Exception:\r\n capture_exception_and_report(\r\n additional_data={\r\n \"function\": func.__name__,\r\n \"args\": str(args),\r\n \"kwargs\": str(kwargs)\r\n }\r\n )\r\n raise\r\n return wrapper\r\n\r\n# Usage\r\n@log_exceptions\r\ndef risky_function():\r\n # Your code here\r\n pass\r\n```\r\n\r\n### Context Manager\r\n\r\n```python\r\nfrom contextlib import contextmanager\r\nfrom huntglitch_python.logger import capture_exception_and_report\r\n\r\n@contextmanager\r\ndef error_reporting(operation_name):\r\n try:\r\n yield\r\n except Exception:\r\n capture_exception_and_report(\r\n additional_data={\"operation\": operation_name}\r\n )\r\n raise\r\n\r\n# Usage\r\nwith error_reporting(\"database_operation\"):\r\n # Your database code here\r\n pass\r\n```\r\n\r\n## \ud83d\udee0\ufe0f Development\r\n\r\n### Running Tests\r\n\r\n```bash\r\n# Install development dependencies\r\npip install -r requirements.txt\r\n\r\n# Run tests\r\npython -m pytest tests/\r\n```\r\n\r\n### Project Structure\r\n\r\n```\r\nhuntglitch-python/\r\n\u251c\u2500\u2500 huntglitch_python/\r\n\u2502 \u251c\u2500\u2500 __init__.py\r\n\u2502 \u2514\u2500\u2500 logger.py\r\n\u251c\u2500\u2500 tests/\r\n\u2502 \u2514\u2500\u2500 test_logger.py\r\n\u251c\u2500\u2500 requirements.txt\r\n\u251c\u2500\u2500 setup.py\r\n\u251c\u2500\u2500 pyproject.toml\r\n\u2514\u2500\u2500 README.md\r\n```\r\n\r\n### Contributing\r\n\r\n1. Fork the repository\r\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\r\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\r\n4. Push to the branch (`git push origin feature/amazing-feature`)\r\n5. Open a Pull Request\r\n\r\n## \ud83d\udd0d Troubleshooting\r\n\r\n### Common Issues\r\n\r\n1. **Missing Environment Variables**: Ensure `PROJECT_KEY` and `DELIVERABLE_KEY` are set\r\n2. **Network Issues**: Check if the API endpoint is accessible\r\n3. **Import Errors**: Verify the package is properly installed\r\n\r\n### Debug Mode\r\n\r\nFor debugging, you can catch and print any errors from the logging itself:\r\n\r\n```python\r\nfrom huntglitch_python.logger import send_huntglitch_log\r\n\r\ntry:\r\n # Your code\r\n pass\r\nexcept Exception as e:\r\n try:\r\n send_huntglitch_log(\r\n error_name=type(e).__name__,\r\n error_value=str(e),\r\n file_name=__file__,\r\n line_number=10\r\n )\r\n except Exception as log_error:\r\n print(f\"Failed to log to HuntGlitch: {log_error}\")\r\n```\r\n\r\n## \ud83d\udcc4 License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n\r\n## \ud83e\udd1d Support\r\n\r\nFor support, email support@huntglitch.com or create an issue in this repository.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Send Python exceptions and logs to HuntGlitch Lighthouse API",
"version": "1.1.0",
"project_urls": {
"Bug Tracker": "https://github.com/huntglitch-npm/huntglitch-python/issues",
"Documentation": "https://github.com/huntglitch-npm/huntglitch-python#readme",
"Homepage": "https://github.com/huntglitch-npm/huntglitch-python",
"Repository": "https://github.com/huntglitch-npm/huntglitch-python.git"
},
"split_keywords": [
"logging",
" error tracking",
" monitoring",
" debugging",
" huntglitch"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "4f0dda665424dd04c06d45f49dcc94d8a42cfcdc708832ebf76f172a563d4fbb",
"md5": "7cad7205062fbaee198d04eff8953f46",
"sha256": "cf8593763f0ffe48a42bb9f60c2fed47152b638aad7437403f3c8f7e1836a185"
},
"downloads": -1,
"filename": "huntglitch_python-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7cad7205062fbaee198d04eff8953f46",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 11010,
"upload_time": "2025-07-29T11:52:39",
"upload_time_iso_8601": "2025-07-29T11:52:39.284763Z",
"url": "https://files.pythonhosted.org/packages/4f/0d/da665424dd04c06d45f49dcc94d8a42cfcdc708832ebf76f172a563d4fbb/huntglitch_python-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "df478bf06b9a68568f3783da2287cdff81d1a6d1bc7144d3117223ab691af6cf",
"md5": "63a4d16ce938398e765c881a2f4c6506",
"sha256": "4657f933d9efc5524c4ee4ace1a5224c81d55755999be66c070485a2a7664445"
},
"downloads": -1,
"filename": "huntglitch_python-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "63a4d16ce938398e765c881a2f4c6506",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 16190,
"upload_time": "2025-07-29T11:52:40",
"upload_time_iso_8601": "2025-07-29T11:52:40.590702Z",
"url": "https://files.pythonhosted.org/packages/df/47/8bf06b9a68568f3783da2287cdff81d1a6d1bc7144d3117223ab691af6cf/huntglitch_python-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-29 11:52:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "huntglitch-npm",
"github_project": "huntglitch-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": [
[
"<",
"3.0.0"
],
[
">=",
"2.25.0"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
"<",
"2.0.0"
],
[
">=",
"0.19.0"
]
]
}
],
"lcname": "huntglitch-python"
}