Skip to main content

log_error

Function log_error 

Source
pub fn log_error(error: &ComposioError, context: Option<&str>)
Expand description

Log an error with appropriate verbosity level

This function logs errors with context-aware formatting:

  • For validation errors (400), uses detailed formatting
  • For other errors, uses standard display
  • Respects the current verbosity level

§Arguments

  • error - The error to log
  • context - Optional context string (e.g., “Session creation”, “Tool execution”)

§Example

use composio_sdk::utils::logging::log_error;
use composio_sdk::error::ComposioError;

let error = ComposioError::ValidationError("Invalid input".to_string());
log_error(&error, Some("Creating session"));