X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Flibvlc.c;h=cff3784c1660d59886f8ce6e58967df8811a4fbc;hb=e8fc5a926bc565ef94efc05acf38ccb567e82965;hp=3d11414bed53028d4f437ea5787c4de056c7ea22;hpb=69ff84b97f1108ec7264d9f4c54d2751f5404065;p=vlc diff --git a/src/libvlc.c b/src/libvlc.c index 3d11414bed..cff3784c16 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -128,6 +128,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, /* System specific initialization code */ system_Init(); + vlc_LogPreinit(p_libvlc); + /* Initialize the module bank and load the configuration of the * core module. We need to do this at this stage to be able to display * a short help if required by the user. (short help == core module @@ -141,7 +143,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, return VLC_EGENERIC; } - vlc_LogInit (p_libvlc); vlc_threads_setup (p_libvlc); /* Load the builtins and plugins into the module_bank. @@ -167,11 +168,13 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, int vlc_optind; if( config_LoadCmdLine( p_libvlc, i_argc, ppsz_argv, &vlc_optind ) ) { - module_EndBank (true); vlc_LogDeinit (p_libvlc); + module_EndBank (true); return VLC_EGENERIC; } + vlc_LogInit(p_libvlc); + /* * Support for gettext */ @@ -191,8 +194,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, if( module_count <= 1 ) { msg_Err( p_libvlc, "No plugins found! Check your VLC installation."); - module_EndBank (true); vlc_LogDeinit (p_libvlc); + module_EndBank (true); return VLC_ENOMOD; } @@ -203,8 +206,8 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc, if( daemon( 1, 0) != 0 ) { msg_Err( p_libvlc, "Unable to fork vlc to daemon mode" ); - module_EndBank (true); vlc_LogDeinit (p_libvlc); + module_EndBank (true); return VLC_ENOMEM; } @@ -452,25 +455,6 @@ dbus_out: free( psz_modules ); free( psz_control ); -#ifdef HAVE_SYSLOG_H - if( var_InheritBool( p_libvlc, "syslog" ) ) - { - char *logmode = var_CreateGetNonEmptyString( p_libvlc, "logmode" ); - var_SetString( p_libvlc, "logmode", "syslog" ); - libvlc_InternalAddIntf( p_libvlc, "logger,none" ); - - if( logmode ) - { - var_SetString( p_libvlc, "logmode", logmode ); - free( logmode ); - } - var_Destroy( p_libvlc, "logmode" ); - } - else -#endif - if( var_InheritBool( p_libvlc, "file-logging" ) ) - libvlc_InternalAddIntf( p_libvlc, "logger,none" ); - if( var_InheritBool( p_libvlc, "network-synchronisation") ) libvlc_InternalAddIntf( p_libvlc, "netsync,none" ); @@ -549,8 +533,8 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc ) config_AutoSaveConfigFile( VLC_OBJECT(p_libvlc) ); /* Free module bank. It is refcounted, so we call this each time */ - module_EndBank (true); vlc_LogDeinit (p_libvlc); + module_EndBank (true); #if defined(_WIN32) || defined(__OS2__) system_End( ); #endif