|
|
@ -152,6 +152,7 @@ pub(crate) fn log(args: LogArgs, level_expr: Option<TokenStream>) -> Result<Toke
|
|
|
|
let len = Ident::new("len", Span::mixed_site());
|
|
|
|
let len = Ident::new("len", Span::mixed_site());
|
|
|
|
let record = Ident::new("record", Span::mixed_site());
|
|
|
|
let record = Ident::new("record", Span::mixed_site());
|
|
|
|
Ok(quote! {
|
|
|
|
Ok(quote! {
|
|
|
|
|
|
|
|
{
|
|
|
|
let #level = #level_expr;
|
|
|
|
let #level = #level_expr;
|
|
|
|
if ::aya_log_ebpf::macro_support::level_enabled(#level) {
|
|
|
|
if ::aya_log_ebpf::macro_support::level_enabled(#level) {
|
|
|
|
match ::aya_log_ebpf::macro_support::AYA_LOG_BUF.get_ptr_mut(0).and_then(|ptr| unsafe { ptr.as_mut() }) {
|
|
|
|
match ::aya_log_ebpf::macro_support::AYA_LOG_BUF.get_ptr_mut(0).and_then(|ptr| unsafe { ptr.as_mut() }) {
|
|
|
@ -183,6 +184,7 @@ pub(crate) fn log(args: LogArgs, level_expr: Option<TokenStream>) -> Result<Toke
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|