Просмотр исходного кода

libobs, UI: Do not log redundant warnings

Reduces log file clutter by not logging certain warning messages that
were already safe/normal/expected failures.
jp9000 6 лет назад
Родитель
Сommit
8f106dc3c1
3 измененных файлов с 8 добавлено и 2 удалено
  1. 1 1
      UI/win-update/win-update.cpp
  2. 1 1
      libobs/obs-module.c
  3. 6 0
      libobs/util/platform-windows.c

+ 1 - 1
UI/win-update/win-update.cpp

@@ -242,7 +242,7 @@ try {
 	return true;
 
 } catch (string text) {
-	blog(LOG_WARNING, "%s: %s", __FUNCTION__, text.c_str());
+	blog(LOG_DEBUG, "%s: %s", __FUNCTION__, text.c_str());
 	return false;
 }
 

+ 1 - 1
libobs/obs-module.c

@@ -26,7 +26,7 @@ extern const char *get_module_extension(void);
 
 static inline int req_func_not_found(const char *name, const char *path)
 {
-	blog(LOG_ERROR, "Required module function '%s' in module '%s' not "
+	blog(LOG_DEBUG, "Required module function '%s' in module '%s' not "
 	                "found, loading of module failed",
 	                name, path);
 	return MODULE_MISSING_EXPORTS;

+ 6 - 0
libobs/util/platform-windows.c

@@ -92,6 +92,12 @@ void *os_dlopen(const char *path)
 
 	if (!h_library) {
 		DWORD error = GetLastError();
+
+		/* don't print error for libraries that aren't meant to be
+		 * dynamically linked */
+		if (error == ERROR_PROC_NOT_FOUND)
+			return NULL;
+
 		char *message = NULL;
 
 		FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM |