Remove log handler for wayland log 15/298715/1
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 12 Sep 2023 23:06:33 +0000 (08:06 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 13 Sep 2023 00:05:05 +0000 (09:05 +0900)
The log handler in libds caused a crash of enlightenment where using
wayland-server APIs in multi threads. That's because the log handler
uses `static` array for keep a format string. Even though it could also
be resolved by removing the static variable, it just removes the log
handler for wayland log in libds so a compositor can configure it by
itself.

Change-Id: I1778fabec38c7cb9b922c8a17b119da387ceacfd

src/log.c

index cc028f8..f63026a 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -28,7 +28,6 @@ static const char *level_headers[] = {
 };
 
 static void log_stderr(enum ds_log_level level, const char *fmt, va_list args);
-static void log_wl(const char *fmt, va_list args);
 
 static ds_log_func_t log_callback = log_stderr;
 
@@ -39,8 +38,6 @@ ds_log_init(enum ds_log_level level, ds_log_func_t callback)
         log_level = level;
     if (callback)
         log_callback = callback;
-
-    wl_log_set_handler_server(log_wl);
 }
 
 WL_EXPORT void
@@ -103,15 +100,3 @@ log_stderr(enum ds_log_level level, const char *fmt, va_list args)
         fprintf(stderr, "\x1B[0m");
     fprintf(stderr, "\n");
 }
-
-static void
-log_wl(const char *fmt, va_list args)
-{
-    static char ds_fmt[1024];
-    int n;
-
-    n = snprintf(ds_fmt, sizeof(ds_fmt), "[wayland] %s", fmt);
-    if (n > 0 && ds_fmt[n - 1] == '\n')
-        ds_fmt[n - 1] = '\0';
-    _ds_vlog(DS_INF, ds_fmt, args);
-}