#include "config/vlc_getopt.h"
-#ifdef HAVE_UNISTD_H
-# include <unistd.h> /* isatty() */
-#endif
-
#ifdef HAVE_DBUS
/* used for one-instance mode */
# include <dbus/dbus.h>
return VLC_EGENERIC;
}
- /*
- * Message queue options (read-only afterwards)
- */
-#if defined (HAVE_ISATTY) && !defined (WIN32)
- if (isatty (STDERR_FILENO))
- priv->b_color = var_InheritBool (p_libvlc, "color");
- else
-#endif
- priv->b_color = false;
-
- priv->i_verbose = var_InheritInteger (p_libvlc, "verbose");
- psz_val = getenv ("VLC_VERBOSE");
- if (psz_val != NULL)
- priv->i_verbose = atoi (psz_val);
-
- if (var_InheritBool (p_libvlc, "quiet"))
- {
- var_Create (p_libvlc, "verbose", VLC_VAR_INTEGER);
- var_SetInteger (p_libvlc, "verbose", -1);
- priv->i_verbose = -1;
- }
-
vlc_LogInit (p_libvlc);
-
- /* Announce who we are (TODO: only first instance?) */
- msg_Dbg( p_libvlc, "VLC media player - %s", VERSION_MESSAGE );
- msg_Dbg( p_libvlc, "%s", COPYRIGHT_MESSAGE );
- msg_Dbg( p_libvlc, "revision %s", psz_vlc_changeset );
- msg_Dbg( p_libvlc, "configured with %s", CONFIGURE_LINE );
vlc_threads_setup (p_libvlc);
/* Load the builtins and plugins into the module_bank.
# include "config.h"
#endif
+#include <stdlib.h>
#include <stdarg.h> /* va_list for BSD */
#ifdef __APPLE__
# include <xlocale.h>
#endif
#include <errno.h> /* errno */
#include <assert.h>
+#include <unistd.h>
#include <vlc_common.h>
#include <vlc_interface.h>
va_list ap;
va_copy (ap, args);
- Win32DebugOutputMsg (&priv->i_verbose, type, &msg, format, ap);
+ Win32DebugOutputMsg (&priv->log.verbose, type, &msg, format, ap);
va_end (ap);
#endif
if (cb == NULL)
{
- cb = priv->b_color ? PrintColorMsg : PrintMsg;
- opaque = (void *)(intptr_t)priv->i_verbose;
+#if defined (HAVE_ISATTY) && !defined (WIN32)
+ if (isatty (STDERR_FILENO) && var_InheritBool (vlc, "color"))
+ cb = PrintColorMsg;
+ else
+#endif
+ cb = PrintMsg;
+ opaque = (void *)(intptr_t)priv->log.verbose;
}
vlc_rwlock_wrlock (&priv->log.lock);
priv->log.cb = cb;
priv->log.opaque = opaque;
vlc_rwlock_unlock (&priv->log.lock);
+
+ /* Announce who we are */
+ msg_Dbg (vlc, "VLC media player - %s", VERSION_MESSAGE);
+ msg_Dbg (vlc, "%s", COPYRIGHT_MESSAGE);
+ msg_Dbg (vlc, "revision %s", psz_vlc_changeset);
+ msg_Dbg (vlc, "configured with %s", CONFIGURE_LINE);
}
void vlc_LogInit (libvlc_int_t *vlc)
{
libvlc_priv_t *priv = libvlc_priv (vlc);
+ const char *str;
+
+ if (var_InheritBool (vlc, "quiet"))
+ priv->log.verbose = -1;
+ else
+ if ((str = getenv ("VLC_VERBOSE")) != NULL)
+ priv->log.verbose = atoi (str);
+ else
+ priv->log.verbose = var_InheritInteger (vlc, "verbose");
vlc_rwlock_init (&priv->log.lock);
vlc_LogSet (vlc, NULL, NULL);