mutter/clutter/clutter/clutter-debug.h
Jonas Dreßler 3d3c88f960 clutter: Don't log filenames in debugging mode
A slightly annoying "feature" of Clutters debug messages is that it also
logs the filename and line of the current debug message. If you don't
have an ultrawide monitor, this can be very annoying and cause lots of
linebreaks in the debug logs.

So remove that debugging feature and no longer log the filename and
line number with debugging messages.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2378>
2022-05-04 19:36:46 +00:00

54 lines
1.8 KiB
C

#ifndef __CLUTTER_DEBUG_H__
#define __CLUTTER_DEBUG_H__
#include <glib.h>
#include "clutter-main.h"
G_BEGIN_DECLS
#ifdef CLUTTER_ENABLE_DEBUG
#define CLUTTER_HAS_DEBUG(type) ((clutter_debug_flags & CLUTTER_DEBUG_##type) != FALSE)
#ifdef __GNUC__
/* Try the GCC extension for valists in macros */
#define CLUTTER_NOTE(type,x,a...) G_STMT_START { \
if (G_UNLIKELY (CLUTTER_HAS_DEBUG (type))) { \
_clutter_debug_message ("[" #type "]: " x, ##a); \
} } G_STMT_END
#else /* !__GNUC__ */
/* Try the C99 version; unfortunately, this does not allow us to pass
* empty arguments to the macro, which means we have to
* do an intemediate printf.
*/
#define CLUTTER_NOTE(type,...) G_STMT_START { \
if (G_UNLIKELY (CLUTTER_HAS_DEBUG (type))) { \
gchar *_fmt = g_strdup_printf (__VA_ARGS__); \
_clutter_debug_message ("[" #type "]: %s", _fmt); \
g_free (_fmt); \
} } G_STMT_END
#endif
#else /* !CLUTTER_ENABLE_DEBUG */
#define CLUTTER_NOTE(type,...) G_STMT_START { } G_STMT_END
#define CLUTTER_HAS_DEBUG(type) FALSE
#endif /* CLUTTER_ENABLE_DEBUG */
extern guint clutter_debug_flags;
extern guint clutter_pick_debug_flags;
extern guint clutter_paint_debug_flags;
extern int clutter_max_render_time_constant_us;
void _clutter_debug_messagev (const char *format,
va_list var_args) G_GNUC_PRINTF (1, 0);
void _clutter_debug_message (const char *format,
...) G_GNUC_PRINTF (1, 2);
G_END_DECLS
#endif /* __CLUTTER_DEBUG_H__ */