Mesa (master): egl: remove no longer needed logger infra

Emil Velikov evelikov at kemper.freedesktop.org
Mon May 8 14:40:52 UTC 2017


Module: Mesa
Branch: master
Commit: 1dd038e98846b1fe77cb61ed2f39bd7d1fea0fb3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1dd038e98846b1fe77cb61ed2f39bd7d1fea0fb3

Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Thu May  4 19:20:17 2017 +0100

egl: remove no longer needed logger infra

As of last commit nobody requires anything else but the
_eglDefaultLogger(). As such use it directly and simplify the
implementation.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Chad Versace <chadversary at chromium.org>

---

 src/egl/main/egllog.c | 48 ++++++------------------------------------------
 src/egl/main/egllog.h |  7 -------
 2 files changed, 6 insertions(+), 49 deletions(-)

diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c
index 9d7e930234..4423272de5 100644
--- a/src/egl/main/egllog.c
+++ b/src/egl/main/egllog.c
@@ -70,14 +70,10 @@ static struct {
 
    EGLBoolean initialized;
    EGLint level;
-   _EGLLogProc logger;
-   EGLint num_messages;
 } logging = {
    _MTX_INITIALIZER_NP,
    EGL_FALSE,
    FALLBACK_LOG_LEVEL,
-   NULL,
-   0
 };
 
 static const char *level_strings[] = {
@@ -91,34 +87,6 @@ static const char *level_strings[] = {
 
 
 /**
- * Set the function to be called when there is a message to log.
- * Note that the function will be called with an internal lock held.
- * Recursive logging is not allowed.
- */
-void
-_eglSetLogProc(_EGLLogProc logger)
-{
-   EGLint num_messages = 0;
-
-   mtx_lock(&logging.mutex);
-
-   if (logging.logger != logger) {
-      logging.logger = logger;
-
-      num_messages = logging.num_messages;
-      logging.num_messages = 0;
-   }
-
-   mtx_unlock(&logging.mutex);
-
-   if (num_messages)
-      _eglLog(_EGL_DEBUG,
-              "New logger installed. "
-              "Messages before the new logger might not be available.");
-}
-
-
-/**
  * The default logger.  It prints the message to stderr.
  */
 static void
@@ -172,7 +140,6 @@ _eglInitLogger(void)
       level = FALLBACK_LOG_LEVEL;
    }
 
-   logging.logger = _eglDefaultLogger;
    logging.level = (level >= 0) ? level : FALLBACK_LOG_LEVEL;
    logging.initialized = EGL_TRUE;
 
@@ -206,16 +173,13 @@ _eglLog(EGLint level, const char *fmtStr, ...)
 
    mtx_lock(&logging.mutex);
 
-   if (logging.logger) {
-      va_start(args, fmtStr);
-      ret = vsnprintf(msg, MAXSTRING, fmtStr, args);
-      if (ret < 0 || ret >= MAXSTRING)
-         strcpy(msg, "<message truncated>");
-      va_end(args);
+   va_start(args, fmtStr);
+   ret = vsnprintf(msg, MAXSTRING, fmtStr, args);
+   if (ret < 0 || ret >= MAXSTRING)
+      strcpy(msg, "<message truncated>");
+   va_end(args);
 
-      logging.logger(level, msg);
-      logging.num_messages++;
-   }
+   _eglDefaultLogger(level, msg);
 
    mtx_unlock(&logging.mutex);
 
diff --git a/src/egl/main/egllog.h b/src/egl/main/egllog.h
index 9035a7a3e7..2a06a34684 100644
--- a/src/egl/main/egllog.h
+++ b/src/egl/main/egllog.h
@@ -44,13 +44,6 @@ extern "C" {
 #define _EGL_DEBUG   3   /* useful info for debugging */
 
 
-typedef void (*_EGLLogProc)(EGLint level, const char *msg);
-
-
-extern void
-_eglSetLogProc(_EGLLogProc logger);
-
-
 extern void
 _eglLog(EGLint level, const char *fmtStr, ...);
 




More information about the mesa-commit mailing list