Skip to content

Logging service for debug#15

Merged
kamilmac merged 17 commits intomainfrom
logging-service-for-debug
May 25, 2025
Merged

Logging service for debug#15
kamilmac merged 17 commits intomainfrom
logging-service-for-debug

Conversation

@kamilmac
Copy link
Copy Markdown
Owner

@kamilmac kamilmac commented May 24, 2025

Summary

This PR introduces a comprehensive logging system throughout the application.
A new logging service has been added to write structured logs to a file. This
service has been integrated into most modules to provide detailed information
about operations, errors, and debugging states.

Changes

  • New Logging Service (src/services/logging.ts):

    • Added a Logger class with info, warning, error, and debug
      static methods.
    • Logs are written in JSON format to APP_CONFIG_DIR/logs/app.log.
    • Uses deno.land/std/fs/ensure_file.ts to ensure the log file and
      directory exist.
  • Widespread Logger Integration:

    • API Server (src/api/server.ts): Added request/response logging
      middleware and specific logs for server initialization, command
      handling, and errors.
    • LLM Provider (src/services/llm_providers/default.ts): Integrated
      logging for provider initialization, stream creation, web search
      operations, and message sending, including error handling.
    • Tools (src/services/tools/*.ts): Added extensive logging within
      all tool processing functions (common, fs, git) for operations,
      arguments, results, and errors. The log parameter in tool process
      functions has been renamed to print.
    • UI Store (src/store/main.ts): Incorporated logging for store
      initialization, state changes (e.g., operation mode, chat history,
      file context), user prompt submissions, and clipboard operations.
    • Configuration (src/utils/config.ts): Added logging for config
      file loading, updating, and error handling. APP_DIR now uses a new
      helper function.
    • Git Utilities (src/utils/git.ts): Implemented logging for git
      command execution, diff generation, commits, and listing modified
      files.
  • Dependency Updates (deno.lock):

    • Added new Deno standard library dependencies for fs utilities
      (ensure_file, _get_file_info_type, _to_path_string,
      ensure_dir) at version std@0.224.0, primarily to support the new
      logging service.
  • Helper Utilities (src/utils/helpers.ts):

    • Introduced getAppConfigDir() function to determine the application's
      configuration directory, used by the logging service and config
      loading.
  • Minor Adjustments:

    • Slightly modified the SYSTEM prompt string in
      src/utils/constants.ts.
    • Adjusted FUZZY_MATCH_SIMILARITY_THRESHOLD in
      src/services/tools/fs.ts.

kamilmac added 17 commits May 24, 2025 09:49
feat: configure linting and increase tool iteration limit

- Add lint config to exclude no-explicit-any rule
- Remove unnecessary deno-lint-ignore comment
- Increase MAX_TOOL_ITERATIONS from 24 to 64
```
- Add TODO checklist to LLM.md for repo context and git tool improvements
- Split git_commit into separate get_diff and commit operations
- Add git_generate_commit_message tool for explicit message generation
- Update git_review and git_create_pr_description to accept diff parameters
- Enable git tools in normal and edit modes for broader accessibility
- Add explicit formatting rules for better readability
- Enforce max 70 characters per line
- Improve line wrapping guidance for generated descriptions
Improve AI's autonomous problem-solving by providing explicit instructions for tool usage in coding tasks.
- Updates Gemini's system prompt to guide the AI to proactively use `git_list_local_modified_files`, `search_files`, and `search_content` for context.
- Expands `git_commit` tool availability to 'normal' mode, allowing more flexible use.
- Applies minor formatting and wording adjustments in system prompts and tool definitions.
- Harmonize indentation of configuration examples and key bindings in README.md.
- Adjust table column widths in README.md for improved readability.
- Correct indentation of object properties in TypeScript source files.
@kamilmac kamilmac merged commit 9027aa7 into main May 25, 2025
1 check passed
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.

1 participant