Skip to content

Add verbose logging and debug output support across all cocli commands #45

@kallal79

Description

@kallal79

Problem Description

Currently, cocli commands provide minimal output during operation, making it difficult to troubleshoot issues or understand what the tool is doing internally. When commands fail, users often get generic error messages without detailed context about the processing steps.

Proposed Solution

Add comprehensive verbose logging support across all cocli commands with:

  1. Global --verbose/-v flag: Enable detailed output for all operations
  2. Structured logging: Show processing steps, file operations, and validation details
  3. Debug mode: Include internal data structures and raw CBOR/JSON content
  4. Progress indicators: For batch operations on multiple files
  5. Performance metrics: Show timing information for operations

Implementation Details

Core Features:

  • Add global verbose flag to root command
  • Implement structured logging with different levels (INFO, DEBUG, TRACE)
  • Show file processing details (reading, parsing, validation steps)
  • Display intermediate data transformations
  • Include timing metrics for performance analysis

Command-Specific Enhancements:

  • comid/corim/cots display: Show parsing steps and validation details
  • corim verify: Display signature verification process and certificate chain details
  • corim extract: Show extraction progress and file writing operations
  • corim submit: Display HTTP request/response details and authentication steps
  • Batch operations: Progress bars and individual file processing status

Example Usage:

# Basic verbose output
cocli corim display --file signed-corim.cbor --verbose

# Debug mode with full details
cocli corim verify --file signed-corim.cbor --key key.jwk --verbose --debug

# Batch processing with progress
cocli comid display --dir comids/ --verbose

Benefits

  1. Improved Debugging: Users can see exactly where operations fail
  2. Better UX: Clear progress indication for long-running operations
  3. Development Aid: Easier to debug cocli itself and understand data flows
  4. Educational: Users can learn about CoRIM/CoMID processing steps
  5. Performance Insights: Identify bottlenecks in large batch operations

Acceptance Criteria

  • Global --verbose flag added to root command
  • Structured logging implementation with configurable levels
  • All commands enhanced with verbose output
  • Progress indicators for batch operations
  • Performance timing metrics
  • Comprehensive test coverage for new logging features
  • Updated documentation with verbose mode examples

This enhancement would significantly improve the user experience and debugging capabilities of cocli without changing any existing functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions