Skip to main content

AI-Native Logging for LLM Agent Development

Project description

VibeCoding Logger

AI-Native Logging for LLM Agent Development - Multi-Language Implementation

VibeCoding Logger is a specialized logging library designed for AI-driven development where LLMs need rich, structured context to understand and debug code effectively. Unlike traditional human-readable logs, this creates "AI briefing packages" with comprehensive context, correlation tracking, and embedded human annotations.

๐ŸŽฏ Concept

In VibeCoding (AI-driven development), the quality of debugging depends on how much context you can provide to the LLM. Traditional logs are designed for humans, but LLMs need structured, machine-readable data with rich context to provide accurate analysis and solutions.

โœจ Key Features

  • ๐Ÿค– AI-Optimized: Structured JSON format optimized for LLM consumption
  • ๐Ÿ“ฆ Rich Context: Function arguments, stack traces, environment info
  • ๐Ÿ”— Correlation Tracking: Track request flows across operations
  • ๐Ÿ’ฌ Human Annotations: Embed AI instructions directly in logs (human_note, ai_todo)
  • โฐ Timestamped Files: Automatic file saving with timestamp-based naming
  • ๐Ÿ”„ Log Rotation: Prevent large files with automatic rotation
  • ๐Ÿงต Thread Safe: Safe for concurrent/multi-threaded applications
  • ๐ŸŒ UTC Timestamps: Consistent timezone handling
  • ๐Ÿ’พ Memory Management: Configurable memory limits to prevent OOM

๐ŸŒ Language Support

Language Status Package Documentation
Python โœ… Stable pip install vibelogger Python Docs
TypeScript/Node.js ๐Ÿšง Need Contributors Coming Soon Contribute!
Go ๐Ÿ“‹ Planned - -
Rust ๐Ÿ“‹ Planned - -

๐Ÿš€ Quick Start (Python)

Installation

pip install vibelogger

Vibe Usage

Just ask Claude Code or Google CLI to use this.

or paste this page for instruction.

Basic Usage

from vibelogger import create_file_logger

# Create logger with auto-save to timestamped file
logger = create_file_logger("my_project")

# Log with rich context for AI analysis
logger.info(
    operation="fetchUserProfile",
    message="Starting user profile fetch",
    context={"user_id": "123", "source": "api_endpoint"},
    human_note="AI-TODO: Check if user exists before fetching profile"
)

# Log exceptions with full context
try:
    result = risky_operation()
except Exception as e:
    logger.log_exception(
        operation="fetchUserProfile",
        exception=e,
        context={"user_id": "123"},
        ai_todo="Suggest proper error handling for this case"
    )

# Get logs formatted for AI analysis
ai_context = logger.get_logs_for_ai()
print(ai_context)  # Send this to your LLM for analysis

For complete Python documentation, see python/README.md.

๐Ÿ“‹ Advanced Usage

Custom Configuration

from vibelogger import create_logger, VibeLoggerConfig

config = VibeLoggerConfig(
    log_file="./logs/custom.log",
    max_file_size_mb=50,
    auto_save=True,
    keep_logs_in_memory=True,
    max_memory_logs=1000
)
logger = create_logger(config=config)

Environment-Based Configuration

from vibelogger import create_env_logger

# Set environment variables:
# VIBE_LOG_FILE=/path/to/logfile.log
# VIBE_MAX_FILE_SIZE_MB=25
# VIBE_AUTO_SAVE=true

logger = create_env_logger()

Memory-Efficient Logging

from vibelogger import VibeLoggerConfig, create_logger

# For long-running processes - disable memory storage
config = VibeLoggerConfig(
    log_file="./logs/production.log",
    keep_logs_in_memory=False,  # Don't store logs in memory
    auto_save=True
)
logger = create_logger(config=config)

๐Ÿ”ง AI Integration

The logger creates structured data that LLMs can immediately understand:

{
  "timestamp": "2025-07-07T08:36:42.123Z",
  "level": "ERROR", 
  "correlation_id": "req_abc123",
  "operation": "fetchUserProfile",
  "message": "User profile not found",
  "context": {
    "user_id": "user-123",
    "query": "SELECT * FROM users WHERE id = ?"
  },
  "environment": {
    "python_version": "3.11.0",
    "os": "Darwin"
  },
  "source": "/app/user_service.py:42 in get_user_profile()",
  "human_note": "AI-TODO: Check database connection",
  "ai_todo": "Analyze why user lookup is failing"
}

Key Fields for AI Analysis

  • timestamp: ISO format with UTC timezone
  • correlation_id: Links related operations across the request
  • operation: What the code was trying to accomplish
  • context: Function arguments, variables, state information
  • environment: Runtime info for reproduction
  • source: Exact file location and function name
  • human_note: Natural language instructions for the AI
  • ai_todo: Specific analysis requests

๐Ÿ“ Log File Organization

Logs are automatically organized with timestamps in your project folder:

./logs/
โ”œโ”€โ”€ my_project/
โ”‚   โ”œโ”€โ”€ vibe_20250707_143052.log
โ”‚   โ”œโ”€โ”€ vibe_20250707_151230.log
โ”‚   โ””โ”€โ”€ vibe_20250707_163045.log.20250707_170000  # Rotated
โ””โ”€โ”€ other_project/
    โ””โ”€โ”€ vibe_20250707_144521.log

๐Ÿ›ก๏ธ Thread Safety

VibeCoding Logger is fully thread-safe:

import threading
from vibelogger import create_file_logger

logger = create_file_logger("multi_threaded_app")

def worker(worker_id):
    logger.info(
        operation="worker_task",
        message=f"Worker {worker_id} processing",
        context={"worker_id": worker_id}
    )

# Safe to use across multiple threads
threads = [threading.Thread(target=worker, args=(i,)) for i in range(10)]
for t in threads:
    t.start()

๐ŸŽฏ VibeCoding Workflow

  1. Code with VibeCoding Logger: Add rich logging to your development process
  2. Run Your Code: Logger captures detailed context automatically
  3. Get AI Analysis: Use logger.get_logs_for_ai() to get formatted data
  4. Send to LLM: Paste the structured logs into your LLM for analysis
  5. Get Precise Solutions: LLM provides targeted fixes with full context

๐Ÿ“š Documentation

Core Documentation

Examples

Framework Integrations

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐ŸŽ‰ Why VibeCoding Logger?

Traditional logging is designed for human debugging. But in the age of AI-assisted development, we need logs that AI can understand and act upon. VibeCoding Logger bridges this gap by providing:

  • Context-Rich Data: Everything an LLM needs to understand the problem
  • Structured Format: Machine-readable JSON instead of human-readable text
  • AI Instructions: Direct communication with your AI assistant
  • Correlation Tracking: Understanding of request flows and relationships

Transform your debugging from "guess and check" to "analyze and solve" with AI-native logging.


Built for the VibeCoding era - where humans design and AI implements. ๐Ÿš€

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vibelogger-0.1.0.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vibelogger-0.1.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file vibelogger-0.1.0.tar.gz.

File metadata

  • Download URL: vibelogger-0.1.0.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.12

File hashes

Hashes for vibelogger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0d376e0d60723ffb2cb5a1d53dfb97fbef5c6ff0170291a071078455caf555a0
MD5 2c0e6f9e4f32cacfa3333cde27f5f1c7
BLAKE2b-256 b66a3435eb31864349f9a23d43c89748f5774a527be2b56fa0a31859ba099a3c

See more details on using hashes here.

File details

Details for the file vibelogger-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vibelogger-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.12

File hashes

Hashes for vibelogger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff375c795358fc04ca82ce5036ac5b65d2b6a846e83e9d7c765ce322e8c980ab
MD5 7904c19ddf151437f631027b85cefc39
BLAKE2b-256 ce55bcb4ad2d0dc1621cc5cda4b76a692baa96e1dc97b1fbdbd11580ac25ae73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page