[epiphany/mcatanzaro/ephy-debug: 8/8] Make ephy-debug available without developer mode




commit 164dd9a7cb1597eca3aede948d85cb489a0630eb
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Nov 28 09:52:06 2020 -0600

    Make ephy-debug available without developer mode
    
    There is zero value to gating these features behind developer mode. It's
    just annoying to not have logging available outside developer mode. And
    developer mode is incompatible with flatpak (because it forces the web
    extension to be loaded from the source directory, but under flatpak it
    needs to be loaded from the install directory), so unless we change
    this, debugging flatpak builds is very hard.
    
    Developer mode stays around to allow loading the web extension from the
    source directory. It just won't gate debug features anymore.

 lib/ephy-debug.c | 10 ----------
 lib/ephy-debug.h | 14 --------------
 2 files changed, 24 deletions(-)
---
diff --git a/lib/ephy-debug.c b/lib/ephy-debug.c
index 35299f3e5..6ee466760 100644
--- a/lib/ephy-debug.c
+++ b/lib/ephy-debug.c
@@ -39,7 +39,6 @@
  * analyze modules. Refer to doc/debugging.txt for more information.
  */
 
-#if DEVELOPER_MODE
 static const char *ephy_debug_break = NULL;
 static GHashTable *ephy_profilers_hash = NULL;
 static char **ephy_profile_modules;
@@ -272,12 +271,3 @@ ephy_debug_init (void)
   ephy_debug_break = g_getenv ("EPHY_DEBUG_BREAK");
   g_log_set_default_handler (trap_handler, NULL);
 }
-
-#else
-
-void
-ephy_debug_init (void)
-{
-}
-
-#endif
diff --git a/lib/ephy-debug.h b/lib/ephy-debug.h
index 6dc155c1f..d4feddc3b 100644
--- a/lib/ephy-debug.h
+++ b/lib/ephy-debug.h
@@ -23,23 +23,13 @@
 #include <glib.h>
 
 G_BEGIN_DECLS
-
-#if DEVELOPER_MODE
 #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
 
-#if DEVELOPER_MODE
 #define START_PROFILER(name)   ephy_profiler_start (name, __FILE__);
 #define STOP_PROFILER(name)   ephy_profiler_stop (name);
-#else
-#define START_PROFILER(name)
-#define STOP_PROFILER(name)
-#endif
 
 typedef struct
 {
@@ -50,13 +40,9 @@ typedef struct
 
 void           ephy_debug_init         (void);
 
-#if DEVELOPER_MODE
-
 void           ephy_profiler_start     (const char *name,
                                         const char *module);
 
 void           ephy_profiler_stop      (const char *name);
 
-#endif
-
 G_END_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]