2 * Copyright (C) 2013 Stefan Sauer <ensonic@users.sf.net>
4 * gstlog.c: tracing module that logs events
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
28 GST_DEBUG_CATEGORY_STATIC (gst_log_debug);
29 #define GST_CAT_DEFAULT gst_log_debug
32 GST_DEBUG_CATEGORY_INIT (gst_log_debug, "log", 0, "log tracer");
33 #define gst_log_tracer_parent_class parent_class
34 G_DEFINE_TYPE_WITH_CODE (GstLogTracer, gst_log_tracer, GST_TYPE_TRACER,
37 static void gst_log_tracer_invoke (GstStructure * s);
40 gst_log_tracer_class_init (GstLogTracerClass * klass)
42 GstTracerClass *gst_tracer_class = GST_TRACER_CLASS (klass);
44 gst_tracer_class->invoke = gst_log_tracer_invoke;
48 gst_log_tracer_init (GstLogTracer * self)
50 g_object_set (self, "mask", GST_TRACER_HOOK_ALL, NULL);
54 gst_log_tracer_invoke (GstStructure * s)
56 gchar *str = gst_structure_to_string (s);
57 /* TODO(ensonic): log to different categories depending on GstHookId */
58 GST_TRACE ("%s", str);