mirror of
https://github.com/chainstacklabs/pumpfun-bonkfun-bot.git
synced 2026-07-27 23:37:45 +00:00
45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
---
|
|
description: Shared utilities and helper functions for common operations. Apply when working with project-wide utilities.
|
|
globs: src/utils/*.py
|
|
alwaysApply: true
|
|
---
|
|
|
|
# Utility Functions Guide
|
|
|
|
## Overview
|
|
|
|
The utils module provides shared functionality and helper methods used throughout the pump-bot system. These utilities handle common concerns like logging.
|
|
|
|
## Core Utilities
|
|
|
|
### Logging
|
|
|
|
@src/utils/logger.py implements a centralized logging system:
|
|
- Consistent log formatting across the application
|
|
- Log level management
|
|
- File and console output handling
|
|
- Context-aware logging with component identification
|
|
|
|
```python
|
|
# Example usage
|
|
logger = get_logger(__name__)
|
|
logger.info("Processing token %s", token_mint)
|
|
```
|
|
|
|
## Common Patterns
|
|
|
|
| Operation | Utility |
|
|
|-----------|---------|
|
|
| Logging | `get_logger(__name__)` |
|
|
|
|
## Best Practices
|
|
|
|
1. **Reuse existing utilities** rather than implementing similar functionality
|
|
2. **Keep utilities focused** on a single responsibility
|
|
3. **Document usage examples** for each utility
|
|
4. **Maintain backward compatibility** when enhancing utilities
|
|
|
|
## Related Files
|
|
|
|
- @src/utils/logger.py: Centralized logging system
|