Skip to content

Commit

Permalink
info: Warn if logging with a non-GObject object if GST_ENABLE_EXTRA_C…
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Dec 2, 2020
1 parent 7c0dcb9 commit b72f379
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions gst/gstinfo.c
Expand Up @@ -530,6 +530,10 @@ gst_debug_log_valist (GstDebugCategory * category, GstDebugLevel level,

g_return_if_fail (category != NULL);

#ifdef GST_ENABLE_EXTRA_CHECKS
g_warn_if_fail (object == NULL || G_IS_OBJECT (object));
#endif

if (level > gst_debug_category_get_threshold (category))
return;

Expand Down Expand Up @@ -1164,6 +1168,10 @@ gst_debug_log_get_line (GstDebugCategory * category, GstDebugLevel level,
gchar *ret, *obj_str = NULL;
const gchar *message_str;

#ifdef GST_ENABLE_EXTRA_CHECKS
g_warn_if_fail (object == NULL || G_IS_OBJECT (object));
#endif

_gst_debug_log_preamble (message, object, &file, &message_str, &obj_str,
&elapsed);

Expand Down Expand Up @@ -1258,6 +1266,10 @@ gst_debug_log_default (GstDebugCategory * category, GstDebugLevel level,
} G_STMT_END
#endif

#ifdef GST_ENABLE_EXTRA_CHECKS
g_warn_if_fail (object == NULL || G_IS_OBJECT (object));
#endif

_gst_debug_log_preamble (message, object, &file, &message_str, &obj,
&elapsed);

Expand Down

0 comments on commit b72f379

Please sign in to comment.