From: Sam Hocevar Date: Tue, 8 Oct 2002 18:10:10 +0000 (+0000) Subject: * ./src/libvlc.c, ./src/misc/messages.c: due to horrible user threats, X-Git-Tag: 0.5.0~893 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=9de9dd0534dc5d374c3edd3128906852c22ce62d;p=vlc * ./src/libvlc.c, ./src/misc/messages.c: due to horrible user threats, only two levels of -v are now possible: -v for warnings, -vv for debug messages (-q for no output at all). --- diff --git a/src/libvlc.c b/src/libvlc.c index df45694bbd..3d52bdf29f 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -2,7 +2,7 @@ * libvlc.c: main libvlc source ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: libvlc.c,v 1.36 2002/10/04 18:07:22 sam Exp $ + * $Id: libvlc.c,v 1.37 2002/10/08 18:10:09 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -165,7 +165,7 @@ vlc_t * vlc_create_r( void ) /* Find verbosity from VLC_VERBOSE environment variable */ psz_env = getenv( "VLC_VERBOSE" ); - libvlc.i_verbose = psz_env ? atoi( psz_env ) : 0; + libvlc.i_verbose = psz_env ? atoi( psz_env ) : -1; #ifdef HAVE_ISATTY libvlc.b_color = isatty( 2 ); /* 2 is for stderr */ @@ -412,14 +412,14 @@ vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] ) */ if( config_GetInt( p_vlc, "quiet" ) ) { - libvlc.i_verbose = 0; + libvlc.i_verbose = -1; } else { int i_tmp = config_GetInt( p_vlc, "verbose" ); if( i_tmp >= 0 ) { - libvlc.i_verbose = __MIN( i_tmp, 4 ); + libvlc.i_verbose = __MIN( i_tmp, 2 ); } } libvlc.b_color = libvlc.b_color || config_GetInt( p_vlc, "color" ); diff --git a/src/libvlc.h b/src/libvlc.h index 5bcc23455e..8e527f3149 100644 --- a/src/libvlc.h +++ b/src/libvlc.h @@ -2,7 +2,7 @@ * libvlc.h: main libvlc header ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: libvlc.h,v 1.18 2002/10/05 19:26:23 jlj Exp $ + * $Id: libvlc.h,v 1.19 2002/10/08 18:10:09 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -37,10 +37,10 @@ "The default behavior is to automatically select the best module " \ "available.") -#define VERBOSE_TEXT N_("verbosity (0-4)") +#define VERBOSE_TEXT N_("verbosity (0,1,2)") #define VERBOSE_LONGTEXT N_( \ - "This options sets the verbosity level (0=no messages, 1=only errors, " \ - "4=max.") + "This options sets the verbosity level (0=only errors and " \ + "standard messages, 1=warnings, 2=debug.") #define QUIET_TEXT N_("be quiet") #define QUIET_LONGTEXT N_( \ diff --git a/src/misc/configuration.c b/src/misc/configuration.c index 28b0556415..eefd41aae8 100644 --- a/src/misc/configuration.c +++ b/src/misc/configuration.c @@ -2,7 +2,7 @@ * configuration.c management of the modules configuration ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: configuration.c,v 1.40 2002/10/03 18:56:09 sam Exp $ + * $Id: configuration.c,v 1.41 2002/10/08 18:10:10 sam Exp $ * * Authors: Gildas Bazin * @@ -883,7 +883,7 @@ int __config_SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name ) int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], vlc_bool_t b_ignore_errors ) { - int i_cmd, i_index, i_opts, i_shortopts, flag; + int i_cmd, i_index, i_opts, i_shortopts, flag, i_verbose = 0; module_t **pp_parser; vlc_list_t *p_list; module_config_t *p_item; @@ -1115,11 +1115,9 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], case CONFIG_ITEM_INTEGER: if( i_cmd == 'v' ) { - int i_verbose = 0; - if( optarg ) { - if( *optarg == 'v' ) /* eg. -vvvvv */ + if( *optarg == 'v' ) /* eg. -vvv */ { i_verbose++; while( *optarg == 'v' ) @@ -1135,7 +1133,7 @@ int __config_LoadCmdLine( vlc_object_t *p_this, int *pi_argc, char *ppsz_argv[], } else { - i_verbose = 1; /* -v */ + i_verbose++; /* -v */ } config_PutInt( p_this, pp_shortopts[i_cmd]->psz_name, i_verbose ); diff --git a/src/misc/messages.c b/src/misc/messages.c index be1ac6afe1..c1f137cd33 100644 --- a/src/misc/messages.c +++ b/src/misc/messages.c @@ -4,7 +4,7 @@ * modules, especially intf modules. See config.h for output configuration. ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: messages.c,v 1.12 2002/10/03 18:56:09 sam Exp $ + * $Id: messages.c,v 1.13 2002/10/08 18:10:10 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -438,16 +438,16 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item ) switch( i_type ) { case VLC_MSG_ERR: - if( p_this->p_libvlc->i_verbose < 1 ) return; + if( p_this->p_libvlc->i_verbose < 0 ) return; break; case VLC_MSG_INFO: - if( p_this->p_libvlc->i_verbose < 2 ) return; + if( p_this->p_libvlc->i_verbose < 0 ) return; break; case VLC_MSG_WARN: - if( p_this->p_libvlc->i_verbose < 3 ) return; + if( p_this->p_libvlc->i_verbose < 1 ) return; break; case VLC_MSG_DBG: - if( p_this->p_libvlc->i_verbose < 4 ) return; + if( p_this->p_libvlc->i_verbose < 2 ) return; break; } diff --git a/src/misc/modules.c b/src/misc/modules.c index ac7f88ef9f..00f4b315be 100644 --- a/src/misc/modules.c +++ b/src/misc/modules.c @@ -2,7 +2,7 @@ * modules.c : Builtin and plugin modules management functions ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules.c,v 1.95 2002/10/03 18:56:10 sam Exp $ + * $Id: modules.c,v 1.96 2002/10/08 18:10:10 sam Exp $ * * Authors: Samuel Hocevar * Ethan C. Baldridge @@ -466,8 +466,8 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability, if( p_module != NULL ) { - msg_Info( p_module, "using %s module \"%s\"", - psz_capability, p_module->psz_object_name ); + msg_Dbg( p_module, "using %s module \"%s\"", + psz_capability, p_module->psz_object_name ); } else if( p_first == NULL ) { @@ -508,7 +508,7 @@ void __module_Unneed( vlc_object_t * p_this, module_t * p_module ) p_module->pf_deactivate( p_this ); } - msg_Info( p_module, "unlocking module \"%s\"", p_module->psz_object_name ); + msg_Dbg( p_module, "unlocking module \"%s\"", p_module->psz_object_name ); vlc_object_release( p_module ); diff --git a/src/vlc.c b/src/vlc.c index db7f4c8707..7a77b71dc5 100644 --- a/src/vlc.c +++ b/src/vlc.c @@ -2,7 +2,7 @@ * vlc.c: the vlc player ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: vlc.c,v 1.12 2002/10/03 18:56:09 sam Exp $ + * $Id: vlc.c,v 1.13 2002/10/08 18:10:09 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -59,10 +59,10 @@ int main( int i_argc, char *ppsz_argv[] ) putenv( "GNOME_DISABLE_CRASH_DIALOG=1" ); # endif - /* If the user isn't using VLC_VERBOSE, set it to 1 by default */ + /* If the user isn't using VLC_VERBOSE, set it to 0 by default */ if( getenv( "VLC_VERBOSE" ) == NULL ) { - putenv( "VLC_VERBOSE=1" ); + putenv( "VLC_VERBOSE=0" ); } #endif