From 520d68ef15077ee491f92e96dfe215823b669711 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Fri, 1 Mar 2019 19:59:13 -0600 Subject: [PATCH] debug: LOG() should print only the file basename It's hard to focus on the important bits when every debug log statement begins with [ ../../../../Projects/epiphany/embed/web-extension/ephy-web-extension.c ]. So let's trim it down to [ ephy-web-extension.c ]. Much better. --- lib/ephy-debug.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ephy-debug.h b/lib/ephy-debug.h index e98c12999..6dc155c1f 100644 --- a/lib/ephy-debug.h +++ b/lib/ephy-debug.h @@ -25,9 +25,10 @@ G_BEGIN_DECLS #if DEVELOPER_MODE -#define LOG(msg, args...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, \ - "[ %s ] " msg, \ - __FILE__ , ## args) +#define LOG(msg, args...) G_STMT_START { \ + g_autofree char *ephy_log_file_basename = g_path_get_basename (__FILE__); \ + g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "[ %s ] " msg, ephy_log_file_basename, ## args); \ + } G_STMT_END #else #define LOG(...) G_STMT_START { } G_STMT_END #endif -- GitLab