]> git.sesse.net Git - vlc/blobdiff - modules/misc/logger.c
Skins2: port Win32 code to UNICODE
[vlc] / modules / misc / logger.c
index cd3b4fdfcb696ee3f35fbf7d8f9d9c6b0f187add..ea827ea76ca6d3b43f6fafb7c5c5d5ae36f14932 100644 (file)
@@ -74,7 +74,7 @@
  *****************************************************************************/
 struct intf_sys_t
 {
-    msg_subscription_t *p_sub;
+    msg_subscription_t sub;
     FILE *p_file;
     const char *footer;
 };
@@ -162,11 +162,11 @@ vlc_module_begin ()
              N_("Log filename"), N_("Specify the log filename."), false )
     add_string( "logmode", "text", LOGMODE_TEXT, LOGMODE_LONGTEXT,
                 false )
-        change_string_list( mode_list, mode_list_text, 0 )
+        change_string_list( mode_list, mode_list_text )
 #ifdef HAVE_SYSLOG_H
     add_string( "syslog-facility", fac_name[0], SYSLOG_FACILITY_TEXT,
                 SYSLOG_FACILITY_LONGTEXT, true )
-        change_string_list( fac_name, fac_name, 0 )
+        change_string_list( fac_name, fac_name )
 #endif
     add_integer( "log-verbose", -1, LOGVERBOSE_TEXT, LOGVERBOSE_LONGTEXT,
            false )
@@ -269,8 +269,8 @@ static int Open( vlc_object_t *p_this )
         if( !psz_file )
         {
 #ifdef __APPLE__
-# define LOG_DIR "Library/Logs/"
-            char *home = config_GetUserDir(VLC_DOCUMENTS_DIR);
+# define LOG_DIR "Library/Logs"
+            char *home = config_GetUserDir(VLC_HOME_DIR);
             if( home == NULL
              || asprintf( &psz_file, "%s/"LOG_DIR"/%s", home,
                           filename ) == -1 )
@@ -298,7 +298,7 @@ static int Open( vlc_object_t *p_this )
         fputs( header, p_sys->p_file );
     }
 
-    p_sys->p_sub = vlc_Subscribe( cb, p_intf );
+    vlc_Subscribe( &p_sys->sub, cb, p_intf );
     return VLC_SUCCESS;
 }
 
@@ -311,7 +311,7 @@ static void Close( vlc_object_t *p_this )
     intf_sys_t *p_sys = p_intf->p_sys;
 
     /* Flush the queue and unsubscribe from the message queue */
-    vlc_Unsubscribe( p_sys->p_sub );
+    vlc_Unsubscribe( &p_sys->sub );
 
     /* Close the log file */
 #ifdef HAVE_SYSLOG_H
@@ -368,7 +368,7 @@ static void AndroidPrint( void *opaque, int type, const msg_item_t *item,
         return;
 
     int canc = vlc_savecancel();
-    __android_log_vprint(prioritytype[type], "vlc", fmt, ap);
+    __android_log_vprint(prioritytype[type], "VLC", fmt, ap);
     vlc_restorecancel( canc );
 }
 #endif
@@ -435,7 +435,7 @@ static void HtmlPrint( void *opaque, int type, const msg_item_t *item,
     fprintf( stream, "%s%s: <span style=\"color: #%06x\">",
              item->psz_module, ppsz_type[type], color[type] );
     /* FIXME: encode special ASCII characters */
-    fprintf( stream, fmt, ap );
+    vfprintf( stream, fmt, ap );
     fputs( "</span>\n", stream );
     funlockfile( stream );
     vlc_restorecancel( canc );