Commit 9de9dd05 authored by Sam Hocevar's avatar Sam Hocevar

* ./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).
parent d6e7c97a
......@@ -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 <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -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" );
......
......@@ -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 <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -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_( \
......
......@@ -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 <gbazin@netcourrier.com>
*
......@@ -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 );
......
......@@ -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 <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -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;
}
......
......@@ -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 <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
......@@ -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 );
......
......@@ -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 <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment