Hello Hugo and everyone,<br><br>I have update the man page and help string in <a href="http://git.videolan.org/?p=vlmc.git;a=commit;h=a1252b597b2cd3628e61d11abc818fde50eb85cb">http://git.videolan.org/?p=vlmc.git;a=commit;h=a1252b597b2cd3628e61d11abc818fde50eb85cb</a><br>

Do you want to introduce a cmd line options like:<br>vlmc --verbose &lt;level&gt;<br>or, vlmc -v &lt;level&gt;<br>or like,<br>vlmc --debug &lt;level&gt;<br>vlmc -d &lt;level&gt;<br>or, vlmc --logfile etc etc... Ideas?<br>

<br>How about introducing a debugging API to be used throughout VLMC instead of qDebug() with colours logging info (time, address etc. as in VLC)<br>Perhaps we can modify and use VlmcDebug... and use it just like qDebug() &lt;&lt; ...<br>

<br>Also, an option to log outputs etc. to a file... giving explicit path in VLMC preferences (so perhaps user can decide...),<br>uncomment and work on some code in VlmcDebug.<br><br>Best Regards,<br>Rohit Yadav<br><br><div class="gmail_quote">

On Mon, Oct 11, 2010 at 4:40 AM,  <span dir="ltr">&lt;<a href="mailto:git@videolan.org">git@videolan.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

vlmc | branch: master | Hugo Beauzée-Luyssen &lt;<a href="mailto:beauze.h@gmail.com">beauze.h@gmail.com</a>&gt; | Mon Oct 11 01:09:34 2010 +0200| [f4d792068750583b777049bacf230b5142b28ee2] | committer: Hugo Beauzée-Luyssen<br>


<br>
VLC debug level can now be set through the command line.<br>
<br>
This will ease the pain when asking a user to enable vlc&#39;s log...<br>
<br>
&gt; <a href="http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=f4d792068750583b777049bacf230b5142b28ee2" target="_blank">http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=f4d792068750583b777049bacf230b5142b28ee2</a><br>


---<br>
<br>
 src/Gui/MainWindow.cpp         |    2 +-<br>
 src/LibVLCpp/VLCInstance.cpp   |   12 +++++++++++-<br>
 src/Settings/SettingsManager.h |    2 ++<br>
 src/Tools/VlmcDebug.cpp        |   29 +++++++++++++++--------------<br>
 src/Tools/VlmcDebug.h          |    7 +++++++<br>
 5 files changed, 36 insertions(+), 16 deletions(-)<br>
<br>
diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp<br>
index 96e057d..eaf40f1 100644<br>
--- a/src/Gui/MainWindow.cpp<br>
+++ b/src/Gui/MainWindow.cpp<br>
@@ -73,7 +73,7 @@ MainWindow::MainWindow( QWidget *parent ) :<br>
     m_ui.setupUi( this );<br>
<br>
     //We only install message handler here cause it uses configuration.<br>
-//    VlmcDebug::getInstance()-&gt;setup();<br>
+    VlmcDebug::getInstance()-&gt;setup();<br>
<br>
     //VLC Instance:<br>
     LibVLCpp::Instance::getInstance();<br>
diff --git a/src/LibVLCpp/VLCInstance.cpp b/src/LibVLCpp/VLCInstance.cpp<br>
index 96717e5..61a64d9 100644<br>
--- a/src/LibVLCpp/VLCInstance.cpp<br>
+++ b/src/LibVLCpp/VLCInstance.cpp<br>
@@ -23,13 +23,16 @@<br>
 #include &quot;VLCInstance.h&quot;<br>
 #include &quot;vlc/vlc.h&quot;<br>
<br>
+#include &quot;SettingsManager.h&quot;<br>
+#include &quot;VlmcDebug.h&quot;<br>
+<br>
 using namespace LibVLCpp;<br>
<br>
 Instance::Instance( QObject* parent /*= NULL*/ ) : QObject( parent )<br>
 {<br>
     char const *argv[] =<br>
     {<br>
-//        &quot;-vvvvv&quot;,<br>
+        &quot;&quot;, //Keep this array entry empty. It will be replaced later if required.<br>
 //        &quot;--ffmpeg-debug&quot;, &quot;3&quot;,<br>
         &quot;--no-skip-frames&quot;,<br>
 //        &quot;--intf&quot;, &quot;dummy&quot;,<br>
@@ -42,6 +45,13 @@ Instance::Instance( QObject* parent /*= NULL*/ ) : QObject( parent )<br>
     };<br>
     int argc = sizeof( argv ) / sizeof( *argv );<br>
<br>
+    int     debugLevel = VLMC_GET_INT( &quot;private/LogLevel&quot; );<br>
+    qDebug() &lt;&lt; debugLevel;<br>
+    if ( debugLevel == VlmcDebug::Debug )<br>
+        argv[0] = &quot;-vv&quot;;<br>
+    else if ( debugLevel == VlmcDebug::Verbose )<br>
+        argv[0] = &quot;-v&quot;;<br>
+<br>
     m_internalPtr = libvlc_new( argc, argv );<br>
     Q_ASSERT_X( m_internalPtr != NULL, &quot;LibVLCpp::Instance::Instance()&quot;,<br>
                 &quot;Can&#39;t launch VLMC without a valid LibVLC instance. Please check your VLC installation&quot; );<br>
diff --git a/src/Settings/SettingsManager.h b/src/Settings/SettingsManager.h<br>
index 3bbf1ee..65975ee 100644<br>
--- a/src/Settings/SettingsManager.h<br>
+++ b/src/Settings/SettingsManager.h<br>
@@ -90,6 +90,8 @@ SettingsManager::getInstance()-&gt;createVar( type, key, defaultValue, name,  \<br>
 //Convenience maccros :<br>
 #define VLMC_CREATE_PRIVATE_PREFERENCE_STRING( key, defaultValue )  \<br>
         VLMC_CREATE_PREFERENCE( SettingValue::String, key, defaultValue, &quot;&quot;, &quot;&quot;, SettingValue::Private )<br>
+#define VLMC_CREATE_PRIVATE_PREFERENCE_INT( key, defaultValue )  \<br>
+        VLMC_CREATE_PREFERENCE( SettingValue::Int, key, defaultValue, &quot;&quot;, &quot;&quot;, SettingValue::Private )<br>
 #define VLMC_CREATE_PRIVATE_PROJECT_STRING( key, defaultValue )  \<br>
         VLMC_CREATE_PROJECT_VAR( SettingValue::String, key, defaultValue, &quot;&quot;, &quot;&quot;, SettingValue::Private )<br>
 #define VLMC_CREATE_PREFERENCE_PASSWORD( key, defaultValue, name, desc )  \<br>
diff --git a/src/Tools/VlmcDebug.cpp b/src/Tools/VlmcDebug.cpp<br>
index 9bbbe9d..6adb3ec 100644<br>
--- a/src/Tools/VlmcDebug.cpp<br>
+++ b/src/Tools/VlmcDebug.cpp<br>
@@ -29,24 +29,25 @@<br>
 VlmcDebug::VlmcDebug() : m_logFile( NULL )<br>
 {<br>
     //setup log level :<br>
+    VLMC_CREATE_PRIVATE_PREFERENCE_INT( &quot;private/LogLevel&quot;, 0 );<br>
     QStringList args = qApp-&gt;arguments();<br>
-    if ( args.indexOf( QRegExp( &quot;-vvv*&quot; ) ) &gt;= 0 )<br>
-        SettingsManager::getInstance()-&gt;setValue( &quot;private/LogLevel&quot;, QtDebugMsg, SettingsManager::Vlmc );<br>
+    if ( args.indexOf( QRegExp( &quot;-vv+&quot; ) ) &gt;= 0 )<br>
+        SettingsManager::getInstance()-&gt;setValue( &quot;private/LogLevel&quot;, VlmcDebug::Debug, SettingsManager::Vlmc );<br>
     else if ( args.contains( &quot;-v&quot; ) == true )<br>
-        SettingsManager::getInstance()-&gt;setValue( &quot;private/LogLevel&quot;, QtWarningMsg, SettingsManager::Vlmc );<br>
+        SettingsManager::getInstance()-&gt;setValue( &quot;private/LogLevel&quot;, VlmcDebug::Verbose, SettingsManager::Vlmc );<br>
     else<br>
-        SettingsManager::getInstance()-&gt;setValue( &quot;private/LogLevel&quot;, QtCriticalMsg, SettingsManager::Vlmc );<br>
+        SettingsManager::getInstance()-&gt;setValue( &quot;private/LogLevel&quot;, VlmcDebug::Quiet, SettingsManager::Vlmc );<br>
<br>
-    int pos = args.indexOf( QRegExp( &quot;--logfile=.*&quot; ) );<br>
-    if ( pos &gt; 0 )<br>
-    {<br>
-        QString arg = args[pos];<br>
-        QString logFile = arg.mid( 10 );<br>
-        if ( logFile.length() &lt;= 0 )<br>
-            qWarning() &lt;&lt; tr(&quot;Invalid value supplied for argument --logfile&quot; );<br>
-        else<br>
-            SettingsManager::getInstance()-&gt;setValue( &quot;private/LogFile&quot;, logFile, SettingsManager::Vlmc );<br>
-    }<br>
+//    int pos = args.indexOf( QRegExp( &quot;--logfile=.*&quot; ) );<br>
+//    if ( pos &gt; 0 )<br>
+//    {<br>
+//        QString arg = args[pos];<br>
+//        QString logFile = arg.mid( 10 );<br>
+//        if ( logFile.length() &lt;= 0 )<br>
+//            qWarning() &lt;&lt; tr(&quot;Invalid value supplied for argument --logfile&quot; );<br>
+//        else<br>
+//            SettingsManager::getInstance()-&gt;setValue( &quot;private/LogFile&quot;, logFile, SettingsManager::Vlmc );<br>
+//    }<br>
<br>
<br>
 //    QVariant setVal = SettingsManager::getInstance()-&gt;value( &quot;private/LogFile&quot;, &quot;log.vlmc&quot;, SettingsManager::Vlmc );<br>
diff --git a/src/Tools/VlmcDebug.h b/src/Tools/VlmcDebug.h<br>
index 2f4eee7..85ba9c5 100644<br>
--- a/src/Tools/VlmcDebug.h<br>
+++ b/src/Tools/VlmcDebug.h<br>
@@ -38,6 +38,13 @@ class   VlmcDebug : public QObject, public Singleton&lt;VlmcDebug&gt;<br>
     Q_OBJECT<br>
<br>
     public:<br>
+        enum    VerboseLevel<br>
+        {<br>
+            Quiet,<br>
+            Verbose,<br>
+            Debug<br>
+        };<br>
+<br>
         static void     vlmcMessageHandler( QtMsgType type, const char* msg );<br>
         void            setup();<br>
     private:<br>
<br>
_______________________________________________<br>
Vlmc-devel mailing list<br>
<a href="mailto:Vlmc-devel@videolan.org">Vlmc-devel@videolan.org</a><br>
<a href="http://mailman.videolan.org/listinfo/vlmc-devel" target="_blank">http://mailman.videolan.org/listinfo/vlmc-devel</a><br>
</blockquote></div><br>