ngx-rust
ngx-rust copied to clipboard
Provide more logging macros
ngx-rust doesn't provide a full set of convenience macros for logging.
We support specific debug logging, but for other logging the user still needs to call the C FFI functions themselves. Needing to provide unnecessary arguments, e.g., in the upstream.rs module example:
ngx_conf_log_error(
NGX_LOG_EMERG as usize,
cf,
0,
"CUSTOM UPSTREAM no upstream srv_conf".as_bytes().as_ptr() as *const i8,
);
This can be simplified with a corresponding macro like we do for ngx_log_debug!
.
As an aside 'eprintln!' goes to the error log which is pretty useful, although not what you're proposing.