mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 19:41:09 +00:00
Implement macros for Element::message_full_with_details()
Allows attaching arbitrary structures to error/warning/info messages
This commit is contained in:
parent
4ab5893359
commit
9734ec29cc
1 changed files with 237 additions and 0 deletions
|
@ -551,6 +551,85 @@ macro_rules! gst_element_error(
|
|||
line!(),
|
||||
);
|
||||
}};
|
||||
|
||||
($obj:expr, $err:expr, ($msg:expr), [$debug:expr], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Error,
|
||||
$err,
|
||||
Some($msg),
|
||||
Some($debug),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, ($msg:expr), details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Error,
|
||||
$err,
|
||||
Some($msg),
|
||||
None,
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, [$debug:expr], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Error,
|
||||
$err,
|
||||
None,
|
||||
Some($debug),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Error,
|
||||
$err,
|
||||
Some(format!($($msg)*)),
|
||||
Some(format!($($debug)*)),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, ($($msg:tt)*), details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Error,
|
||||
$err,
|
||||
Some(format!($($msg)*)),
|
||||
None,
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, [$($debug:tt)*], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Error,
|
||||
$err,
|
||||
None,
|
||||
Some(format!($($debug)*)),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
);
|
||||
|
||||
#[macro_export]
|
||||
|
@ -627,6 +706,85 @@ macro_rules! gst_element_warning(
|
|||
line!(),
|
||||
);
|
||||
}};
|
||||
|
||||
($obj:expr, $err:expr, ($msg:expr), [$debug:expr], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Warning,
|
||||
$err,
|
||||
Some($msg),
|
||||
Some($debug),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, ($msg:expr), details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Warning,
|
||||
$err,
|
||||
Some($msg),
|
||||
None,
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, [$debug:expr], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Warning,
|
||||
$err,
|
||||
None,
|
||||
Some($debug),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Warning,
|
||||
$err,
|
||||
Some(format!($($msg)*)),
|
||||
Some(format!($($debug)*)),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, ($($msg:tt)*), details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Warning,
|
||||
$err,
|
||||
Some(format!($($msg)*)),
|
||||
None,
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, [$($debug:tt)*], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Warning,
|
||||
$err,
|
||||
None,
|
||||
Some(format!($($debug)*)),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
);
|
||||
|
||||
#[macro_export]
|
||||
|
@ -703,6 +861,85 @@ macro_rules! gst_element_info(
|
|||
line!(),
|
||||
);
|
||||
}};
|
||||
|
||||
($obj:expr, $err:expr, ($msg:expr), [$debug:expr], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Info,
|
||||
$err,
|
||||
Some($msg),
|
||||
Some($debug),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, ($msg:expr), details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Info,
|
||||
$err,
|
||||
Some($msg),
|
||||
None,
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, [$debug:expr], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Info,
|
||||
$err,
|
||||
None,
|
||||
Some($debug),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, ($($msg:tt)*), [$($debug:tt)*], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Info,
|
||||
$err,
|
||||
Some(format!($($msg)*)),
|
||||
Some(format!($($debug)*)),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, ($($msg:tt)*), details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Info,
|
||||
$err,
|
||||
Some(format!($($msg)*)),
|
||||
None,
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
($obj:expr, $err:expr, [$($debug:tt)*], details: $details:expr) => { {
|
||||
use $crate::ElementExtManual;
|
||||
$obj.message_full_with_details(
|
||||
$crate::ElementMessageType::Info,
|
||||
$err,
|
||||
None,
|
||||
Some(format!($($debug)*)),
|
||||
file!(),
|
||||
module_path!(),
|
||||
line!(),
|
||||
$details,
|
||||
);
|
||||
}};
|
||||
);
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Reference in a new issue