[vlc-devel] [PATCH] src: Win32: add message categories to debug logs

Edward Wang edward.c.wang at compdigitec.com
Sun Feb 3 15:12:04 CET 2013


---
 src/misc/messages.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/misc/messages.c b/src/misc/messages.c
index 1d8fd0b..d754b7c 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -325,9 +325,14 @@ static void Win32DebugOutputMsg (void* d, int type, const msg_item_t *p_item,
             msg[msg_len] = '\n';
             msg[msg_len + 1] = '\0';
         }
-        wchar_t *wmsg = ToWide(msg);
-        OutputDebugStringW(wmsg);
-        free(wmsg);
+        char* psz_msg = NULL;
+        if(asprintf(&psz_msg, "%s %s%s: %s", p_item->psz_module,
+                    p_item->psz_object_type, msg_type[type], msg) > 0) {
+            wchar_t* wmsg = ToWide(psz_msg);
+            OutputDebugStringW(wmsg);
+            free(wmsg);
+            free(psz_msg);
+        }
     }
     free(msg);
 }
-- 
1.7.5.4




More information about the vlc-devel mailing list