[vlmc-devel] Rename VlmcDebug to VlmcLogger

Hugo Beauzée-Luyssen git at videolan.org
Sat Feb 8 18:48:25 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sat Feb  8 19:00:48 2014 +0200| [d037215a21ad07f734b483a6a52998334fd077d3] | committer: Hugo Beauzée-Luyssen

Rename VlmcDebug to VlmcLogger

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=d037215a21ad07f734b483a6a52998334fd077d3
---

 src/CMakeLists.txt                          |    2 +-
 src/Gui/MainWindow.cpp                      |    4 ++--
 src/LibVLCpp/VLCInstance.cpp                |    6 ++---
 src/Tools/{VlmcDebug.cpp => VlmcLogger.cpp} |   34 +++++++++++++--------------
 src/Tools/{VlmcDebug.h => VlmcLogger.h}     |   10 ++++----
 5 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4b6b9b4..d27a622 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -41,7 +41,7 @@ SET(VLMC_SRCS
     Tools/QSingleton.hpp
     Tools/Singleton.hpp
     Tools/Toggleable.hpp
-    Tools/VlmcDebug.cpp
+	Tools/VlmcLogger.cpp
     Workflow/AudioClipWorkflow.cpp
     Workflow/ClipWorkflow.cpp
     Workflow/ClipHelper.cpp
diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index af06a26..a474d90 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -36,7 +36,7 @@
 #include "config.h"
 #include "Library.h"
 #include "About.h"
-#include "VlmcDebug.h"
+#include "VlmcLogger.h"
 
 #include "EffectsEngine/EffectsEngine.h"
 #include "MainWorkflow.h"
@@ -73,7 +73,7 @@ MainWindow::MainWindow( QWidget *parent ) :
     m_ui.setupUi( this );
 
     //We only install message handler here cause it uses configuration.
-    VlmcDebug::getInstance()->setup();
+    VlmcLogger::getInstance()->setup();
 
     //VLC Instance:
     LibVLCpp::Instance::getInstance();
diff --git a/src/LibVLCpp/VLCInstance.cpp b/src/LibVLCpp/VLCInstance.cpp
index d22b3bb..7f68bf5 100644
--- a/src/LibVLCpp/VLCInstance.cpp
+++ b/src/LibVLCpp/VLCInstance.cpp
@@ -24,7 +24,7 @@
 #include "vlc/vlc.h"
 
 #include "SettingsManager.h"
-#include "VlmcDebug.h"
+#include "VlmcLogger.h"
 
 #include <QVector>
 
@@ -43,9 +43,9 @@ Instance::Instance( QObject* parent /*= NULL*/ ) : QObject( parent )
         << "--no-disable-screensaver";             //No need to disable the screensaver, and save a thread.
 
     int     debugLevel = VLMC_GET_INT( "private/LogLevel" );
-    if ( debugLevel == VlmcDebug::Debug )
+    if ( debugLevel == VlmcLogger::Debug )
         argv << "-vv";
-    else if ( debugLevel == VlmcDebug::Verbose )
+    else if ( debugLevel == VlmcLogger::Verbose )
         argv << "-v";
 
     m_internalPtr = libvlc_new( argv.count(), &argv.front() );
diff --git a/src/Tools/VlmcDebug.cpp b/src/Tools/VlmcLogger.cpp
similarity index 84%
rename from src/Tools/VlmcDebug.cpp
rename to src/Tools/VlmcLogger.cpp
index b8262c1..17e465f 100644
--- a/src/Tools/VlmcDebug.cpp
+++ b/src/Tools/VlmcLogger.cpp
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * VlmcDebug.cpp: Debug tools for VLMC
+ * VlmcLogger.cpp: Debug tools for VLMC
  *****************************************************************************
  * Copyright (C) 2008-2010 VideoLAN
  *
@@ -21,18 +21,18 @@
  *****************************************************************************/
 
 #include "SettingsManager.h"
-#include "VlmcDebug.h"
+#include "VlmcLogger.h"
 
 #include <QCoreApplication>
 #include <QDesktopServices>
 #include <QStringList>
 #include <QThread>
 
-VlmcDebug::VlmcDebug() : m_logFile( NULL )
+VlmcLogger::VlmcLogger() : m_logFile( NULL )
 {
     //setup log level :
     {
-        SettingValue* logLevel = VLMC_CREATE_PREFERENCE( SettingValue::Int, "private/LogLevel", (int)VlmcDebug::Quiet,
+        SettingValue* logLevel = VLMC_CREATE_PREFERENCE( SettingValue::Int, "private/LogLevel", (int)VlmcLogger::Quiet,
                                                         "", "", SettingValue::Private | SettingValue::Clamped );
         logLevel->setLimits((int)Debug, (int)Verbose);
         // Purposedly destroying the setting value, as we need to use the manager for other operations.
@@ -40,11 +40,11 @@ VlmcDebug::VlmcDebug() : m_logFile( NULL )
     }
     QStringList args = qApp->arguments();
     if ( args.indexOf( QRegExp( "-vv+" ) ) >= 0 )
-        m_currentLogLevel = VlmcDebug::Debug;
+        m_currentLogLevel = VlmcLogger::Debug;
     else if ( args.contains( "-v" ) == true )
-        m_currentLogLevel = VlmcDebug::Verbose;
+        m_currentLogLevel = VlmcLogger::Verbose;
     else
-        m_currentLogLevel = VlmcDebug::Quiet;
+        m_currentLogLevel = VlmcLogger::Quiet;
     SettingsManager* settingsManager = SettingsManager::getInstance();
     settingsManager->setValue( "private/LogLevel", m_currentLogLevel, SettingsManager::Vlmc );
     settingsManager->watchValue( "private/LogLevel", this, SLOT(logLevelChanged( const QVariant& )),
@@ -80,26 +80,26 @@ VlmcDebug::VlmcDebug() : m_logFile( NULL )
 //    }
 }
 
-VlmcDebug::~VlmcDebug()
+VlmcLogger::~VlmcLogger()
 {
     if ( m_logFile )
         fclose( m_logFile );
 }
 
 void
-VlmcDebug::setup()
+VlmcLogger::setup()
 {
-    qInstallMsgHandler( VlmcDebug::vlmcMessageHandler );
+    qInstallMsgHandler( VlmcLogger::vlmcMessageHandler );
 }
 
 void
-VlmcDebug::logLevelChanged( const QVariant &logLevel )
+VlmcLogger::logLevelChanged( const QVariant &logLevel )
 {
 
-    Q_ASSERT_X(logLevel.toInt() >= (int)VlmcDebug::Debug &&
-               logLevel.toInt() <= (int)VlmcDebug::Quiet,
+    Q_ASSERT_X(logLevel.toInt() >= (int)VlmcLogger::Debug &&
+               logLevel.toInt() <= (int)VlmcLogger::Quiet,
                "Setting log level", "Invalid value for log level");
-    m_currentLogLevel = (VlmcDebug::LogLevel)logLevel.toInt();
+    m_currentLogLevel = (VlmcLogger::LogLevel)logLevel.toInt();
 }
 
 /*********************************************************************
@@ -107,7 +107,7 @@ VlmcDebug::logLevelChanged( const QVariant &logLevel )
 *********************************************************************/
 
 void
-VlmcDebug::writeToFile(const char *msg)
+VlmcLogger::writeToFile(const char *msg)
 {
     flockfile( m_logFile );
     fputs( msg, m_logFile );
@@ -116,12 +116,12 @@ VlmcDebug::writeToFile(const char *msg)
 }
 
 void
-VlmcDebug::vlmcMessageHandler( QtMsgType type, const char* msg )
+VlmcLogger::vlmcMessageHandler( QtMsgType type, const char* msg )
 {
     //FIXME: This is ok as long as we guarantee no log message will arrive after
     // we uninstall the hook
 
-    VlmcDebug* self = VlmcDebug::getInstance();
+    VlmcLogger* self = VlmcLogger::getInstance();
     if ( self->m_logFile != NULL )
     {
         //FIXME: Messages are not guaranteed to arrive in order
diff --git a/src/Tools/VlmcDebug.h b/src/Tools/VlmcLogger.h
similarity index 91%
rename from src/Tools/VlmcDebug.h
rename to src/Tools/VlmcLogger.h
index 8344d30..ed82787 100644
--- a/src/Tools/VlmcDebug.h
+++ b/src/Tools/VlmcLogger.h
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * VlmcDebug.h: Debug tools for VLMC
+ * VlmcLogger.h: Debug tools for VLMC
  *****************************************************************************
  * Copyright (C) 2008-2010 VideoLAN
  *
@@ -34,7 +34,7 @@
  *  \warning    Do not use qDebug() qWarning() etc... from here, unless you know exactly what you're doing
  *              Chances are very high that you end up with a stack overflow !!
  */
-class   VlmcDebug : public QObject, public Singleton<VlmcDebug>
+class   VlmcLogger : public QObject, public Singleton<VlmcLogger>
 {
     Q_OBJECT
 
@@ -52,8 +52,8 @@ class   VlmcDebug : public QObject, public Singleton<VlmcDebug>
         static void     vlmcMessageHandler( QtMsgType type, const char* msg );
         void            setup();
     private:
-        VlmcDebug();
-        virtual ~VlmcDebug();
+        VlmcLogger();
+        virtual ~VlmcLogger();
         void            writeToFile(const char* msg);
 
         FILE*           m_logFile;
@@ -62,7 +62,7 @@ class   VlmcDebug : public QObject, public Singleton<VlmcDebug>
     private slots:
         void            logLevelChanged( const QVariant& logLevel );
 
-        friend class    Singleton<VlmcDebug>;
+        friend class    Singleton<VlmcLogger>;
 };
 
 #endif // VLMCDEBUG_H



More information about the Vlmc-devel mailing list