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
#[macro_export]
macro_rules! ngx_debug  {
    ($level:expr,$log:expr,$($arg:tt)*) => {
        if (*$log).log_level & $level as usize > 0{
            let c_message = ::std::ffi::CString::new(format!($($arg)*)).unwrap_or_default();
            $crate::ngx_log_error_core($crate::NGX_LOG_DEBUG as usize, $log, 0, c_message.as_ptr());
        }
    }
}

#[macro_export]
macro_rules! ngx_http_debug  {
    ($request:expr,$($arg:tt)*) => {
        unsafe  {
            ngx_debug!($crate::NGX_LOG_DEBUG_HTTP,(*($request).connection).log,$($arg)*);
        }
    }
}

#[macro_export]
macro_rules! ngx_event_debug  {
    ($($arg:tt)*) => {
        unsafe  {
            ngx_debug!($crate::NGX_LOG_DEBUG_EVENT,(*$crate::ngx_cycle).log,$($arg)*);
        }
    }
}