Skip to content

Add @tool2agent/middleware-logging package#15

Open
konard wants to merge 3 commits intotool2agent:masterfrom
konard:issue-2-ff3e9b6b4ac2
Open

Add @tool2agent/middleware-logging package#15
konard wants to merge 3 commits intotool2agent:masterfrom
konard:issue-2-ff3e9b6b4ac2

Conversation

@konard
Copy link
Copy Markdown

@konard konard commented Dec 27, 2025

Summary

  • Implements a logging middleware for tool2agent that logs tool call inputs, outputs, and timing information
  • The logger function is configurable (as requested in the issue)
  • Supports both sync and async logger functions
  • Provides rich log entries including input, result, options, duration, and timestamps

Features

  • Configurable logger: Pass any function that receives LogEntry<InputType, OutputType>
  • Async support: Logger can be async for sending logs to external services
  • Timing information: Measures execution duration in milliseconds with start/complete timestamps
  • Composable: Works with other middleware via pipe()

Test plan

  • Unit tests for basic functionality (logging input, result, options)
  • Unit tests for timing information (duration, startedAt, completedAt)
  • Unit tests for async logger support
  • Unit tests for error/failure logging
  • Unit tests for multiple tool calls
  • Unit tests for complex input/output types
  • All 13 tests passing

Fixes #2

🤖 Generated with Claude Code

konard and others added 2 commits December 27, 2025 11:50
Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: tool2agent#2
Implements a logging middleware for tool2agent that logs tool call inputs,
outputs, and timing information with a configurable logger function.

Features:
- Configurable logger function (sync or async)
- Logs input, result, tool call options, and timing info
- Duration measurement in milliseconds
- Start and completion timestamps
- Composable with other middleware via pipe()

Closes tool2agent#2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Middleware request: logging Add @tool2agent/middleware-logging package Dec 27, 2025
@konard konard marked this pull request as ready for review December 27, 2025 10:59
@konard
Copy link
Copy Markdown
Author

konard commented Dec 27, 2025

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $4.530246 USD
  • Calculated by Anthropic: unknown
  • Difference: unknown
    📎 Log file uploaded as GitHub Gist (533KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Middleware request: logging

1 participant