forked from mirrors/gstreamer-rs
gstreamer/log: Allow any glib::Object as target for logging
gst::Object is not actually required. For plain glib::Objects only the pointer address is printed instead of a name but it works fine.
This commit is contained in:
parent
e585b37923
commit
71497e77de
2 changed files with 4 additions and 4 deletions
|
@ -130,7 +130,7 @@ impl LoggableError {
|
|||
|
||||
pub fn log(&self) {
|
||||
self.category.log(
|
||||
None as Option<&::Object>,
|
||||
None as Option<&glib::Object>,
|
||||
::DebugLevel::Error,
|
||||
self.bool_error.filename,
|
||||
self.bool_error.function,
|
||||
|
@ -139,7 +139,7 @@ impl LoggableError {
|
|||
);
|
||||
}
|
||||
|
||||
pub fn log_with_object<O: IsA<::Object>>(&self, obj: &O) {
|
||||
pub fn log_with_object<O: IsA<glib::Object>>(&self, obj: &O) {
|
||||
self.category.log(
|
||||
Some(obj),
|
||||
::DebugLevel::Error,
|
||||
|
|
|
@ -124,7 +124,7 @@ impl DebugCategory {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn log<O: IsA<::Object>>(
|
||||
pub fn log<O: IsA<glib::Object>>(
|
||||
self,
|
||||
obj: Option<&O>,
|
||||
level: ::DebugLevel,
|
||||
|
@ -304,7 +304,7 @@ macro_rules! gst_log_with_level(
|
|||
module_path!(), line!(), format_args!($($args)*))
|
||||
}};
|
||||
($cat:expr, level: $level:expr, $($args:tt)*) => { {
|
||||
$crate::DebugCategory::log($cat.clone(), None as Option<&$crate::Object>, $level, file!(),
|
||||
$crate::DebugCategory::log($cat.clone(), None as Option<&$crate::glib::Object>, $level, file!(),
|
||||
module_path!(), line!(), format_args!($($args)*))
|
||||
}};
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue