]> git.sesse.net Git - vlc/commitdiff
lua: Print debug message only if really wanted.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 17 Sep 2007 14:37:15 +0000 (14:37 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 17 Sep 2007 14:37:15 +0000 (14:37 +0000)
modules/misc/lua/luameta.c
modules/misc/lua/vlclua.h

index bb9849804faa6212d510ec3e33005dd235c6b4e4..4374ada350922b2db10720533f336971c42d3950 100644 (file)
@@ -173,7 +173,7 @@ static int fetch_art( vlc_object_t *p_this, const char * psz_filename,
             psz_value = lua_tostring( p_state, s );
             if( psz_value && *psz_value != 0 )
             {
-                msg_Dbg( p_this, "setting arturl: %s", psz_value );
+                lua_Dbg( p_this, "setting arturl: %s", psz_value );
                 input_item_SetArtURL ( p_input, psz_value );
                 i_ret = VLC_SUCCESS;
             }
index 1137b0cbe4b731d8c30a87ec736a3d9884242feb..79fdaa4cb8e33728e412fea75dcb7fc0c3eda291 100644 (file)
@@ -57,6 +57,23 @@ int E_(FindMeta)( vlc_object_t * );
 int E_(Import_LuaPlaylist)( vlc_object_t * );
 void E_(Close_LuaPlaylist)( vlc_object_t * );
 
+
+/*****************************************************************************
+ * Lua debug
+ *****************************************************************************/
+static inline void lua_Dbg( vlc_object_t * p_this, const char * ppz_fmt, ... )
+{
+    if( p_this->p_libvlc->i_verbose < 3 )
+        return;
+
+    va_list ap;
+    va_start( ap, ppz_fmt );
+    __msg_GenericVa( ( vlc_object_t *)p_this, MSG_QUEUE_NORMAL,
+                      VLC_MSG_DBG, MODULE_STRING,
+                      ppz_fmt, ap );
+    va_end( ap );
+}
+
 /*****************************************************************************
  * Lua function bridge
  *****************************************************************************/