[epiphany/mcatanzaro/ephy-log: 3/3] debug: LOG() should print only the file basename
- From: Jan-Michael Brummer <jbrummer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/ephy-log: 3/3] debug: LOG() should print only the file basename
- Date: Sat, 2 Mar 2019 07:02:48 +0000 (UTC)
commit 520d68ef15077ee491f92e96dfe215823b669711
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Fri Mar 1 19:59:13 2019 -0600
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]