pub struct LoggingUtils;Expand description
Unified LoggingUtils facade that combines all logging functionality
This struct provides a unified interface to all logging utilities, maintaining backward compatibility with the original API.
Implementations§
Source§impl LoggingUtils
impl LoggingUtils
pub fn print_verbose(message: &str, logger_only: bool, log_level: LogLevel)
pub fn is_verbose_enabled() -> bool
pub fn set_verbose(enabled: bool)
pub fn get_logging_id() -> String
pub fn get_logging_id_with_timestamp(start_time: DateTime<Utc>) -> String
pub fn init_logger(log_level: Option<LogLevel>) -> Result<(), ProviderError>
pub fn setup_file_logging( log_file_path: &str, ) -> Result<Arc<Mutex<BufWriter<File>>>, ProviderError>
pub fn log_to_file( writer: &Arc<Mutex<BufWriter<File>>>, entry: &LogEntry, ) -> Result<(), ProviderError>
pub fn log_request_start( request_id: &str, model: &str, provider: &str, endpoint: &str, )
pub fn log_request_end( request_id: &str, status_code: Option<u16>, duration_ms: u64, token_usage: Option<(usize, usize)>, )
pub fn log_error( request_id: Option<&str>, error: &ProviderError, context: Option<HashMap<String, String>>, )
pub fn log_performance_metrics( operation: &str, duration: Duration, metadata: Option<HashMap<String, String>>, )
pub fn sanitize_log_data(data: &str) -> String
pub fn mask_sensitive_data(input: &str) -> String
pub fn create_structured_log( level: LogLevel, message: &str, module: Option<&str>, metadata: Option<HashMap<String, Value>>, ) -> LogEntry
pub fn get_log_level_from_env() -> LogLevel
pub fn should_log_at_level( current_level: &LogLevel, target_level: &LogLevel, ) -> bool
pub fn format_duration(duration: Duration) -> String
Auto Trait Implementations§
impl Freeze for LoggingUtils
impl RefUnwindSafe for LoggingUtils
impl Send for LoggingUtils
impl Sync for LoggingUtils
impl Unpin for LoggingUtils
impl UnsafeUnpin for LoggingUtils
impl UnwindSafe for LoggingUtils
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> BudgetAwareRouting for T
impl<T> BudgetAwareRouting for T
Source§fn filter_by_budget(
&self,
providers: Vec<String>,
budget_router: &BudgetAwareRouter,
) -> Vec<String>
fn filter_by_budget( &self, providers: Vec<String>, budget_router: &BudgetAwareRouter, ) -> Vec<String>
Filter providers based on budget availability
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.