# include <android/log.h>
#endif
-#define MODE_TEXT 0
-#define MODE_HTML 1
-#define MODE_SYSLOG 2
-
-#ifdef __APPLE__
-#define LOG_DIR "Library/Logs/"
-#endif
-
#define LOG_FILE_TEXT "vlc-log.txt"
#define LOG_FILE_HTML "vlc-log.html"
if( p_sys == NULL )
return VLC_ENOMEM;
+ p_sys->p_file = NULL;
msg_callback_t cb = TextPrint;
const char *filename = LOG_FILE_TEXT, *header = TEXT_HEADER;
p_sys->footer = TEXT_FOOTER;
else
#endif
#ifdef __ANDROID__
- if( cb != AndroidPrint )
+ if( cb == AndroidPrint )
+ {
+ /* nothing to do */
+ }
+ else
#endif
{
char *psz_file = var_InheritString( p_intf, "logfile" );
if( !psz_file )
{
#ifdef __APPLE__
- 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 )
closelog();
else
#endif
+ if( p_sys->p_file )
{
fputs( p_sys->footer, p_sys->p_file );
fclose( p_sys->p_file );