1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! FastEdge utility functions (ProxyWasm API).
//!
//! This module provides diagnostic and monitoring utilities through the ProxyWasm FFI interface.
//!
//! # Examples
//!
//! ```no_run
//! use fastedge::proxywasm::utils;
//!
//! // Log diagnostic information
//! utils::set_user_diag("Processing started for user 12345");
//! ```
/// Sets a diagnostic message for debugging and monitoring.
///
/// This function allows you to log custom diagnostic messages that can be viewed
/// in the FastEdge platform logs. Use it for debugging, monitoring, and tracking
/// application behavior.
///
/// # Arguments
///
/// * `value` - The diagnostic message to log
///
/// # Panics
///
/// Panics if the operation fails (non-zero status code from host).
///
/// # Examples
///
/// ```no_run
/// use fastedge::proxywasm::utils;
///
/// utils::set_user_diag("Request processing completed successfully");
///
/// let item_count = 42;
/// utils::set_user_diag(&format!("Processed {} items", item_count));
/// ```
///
/// # Note
///
/// Diagnostic messages should be used judiciously as they may impact performance.
/// Avoid logging sensitive information such as passwords or API keys.