1
0
Fork 0

Use nih_debug_assert_failure!() in derive macros

Instead of nih_log!(). These messages won't appear in release builds.
This commit is contained in:
Robbert van der Helm 2022-04-11 17:47:32 +02:00
parent 329d1a63ab
commit 2ae5aa429a

View file

@ -174,7 +174,11 @@ pub fn derive_params(input: TokenStream) -> TokenStream {
serialized.insert(String::from(#persist_key), data); serialized.insert(String::from(#persist_key), data);
} }
Err(err) => { Err(err) => {
::nih_plug::nih_log!("Could not serialize '{}': {}", #persist_key, err) ::nih_plug::nih_debug_assert_failure!(
"Could not serialize '{}': {}",
#persist_key,
err
)
} }
}; };
}); });
@ -188,7 +192,7 @@ pub fn derive_params(input: TokenStream) -> TokenStream {
); );
} }
Err(err) => { Err(err) => {
::nih_plug::nih_log!( ::nih_plug::nih_debug_assert_failure!(
"Could not deserialize '{}': {}", "Could not deserialize '{}': {}",
#persist_key, #persist_key,
err err
@ -267,7 +271,7 @@ pub fn derive_params(input: TokenStream) -> TokenStream {
for (field_name, data) in serialized { for (field_name, data) in serialized {
match field_name.as_str() { match field_name.as_str() {
#(#field_deserialize_tokens)* #(#field_deserialize_tokens)*
_ => ::nih_plug::nih_log!("Unknown serialized field name: {} (this may not be accurate)", field_name), _ => ::nih_plug::nih_debug_assert_failure!("Unknown serialized field name: {} (this may not be accurate)", field_name),
} }
} }