Commit bd0edcc0 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Replace qDebug & friends with a vlmc wrapper.

Loglines now contain thread ID, time, and a severity level marker
parent d037215a
......@@ -41,6 +41,7 @@ SET(VLMC_SRCS
Tools/QSingleton.hpp
Tools/Singleton.hpp
Tools/Toggleable.hpp
Tools/VlmcDebug.h
Tools/VlmcLogger.cpp
Workflow/AudioClipWorkflow.cpp
Workflow/ClipWorkflow.cpp
......
......@@ -34,8 +34,6 @@
#ifdef WITH_GUI
# include "UndoStack.h"
#include <QtDebug>
void
Commands::trigger( QUndoCommand* command )
{
......
......@@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QtDebug>
#include <QAction>
#include "SettingValue.h"
......
......@@ -23,7 +23,7 @@
#include "Effect.h"
#include "EffectInstance.h"
#include <QtDebug>
#include "VlmcDebug.h"
Effect::Effect( const QString &fileName ) :
QLibrary( fileName ),
......@@ -53,7 +53,7 @@ dest = reinterpret_cast<typeof( dest )>( resolve( symbolName ) )
#define LOAD_FREI0R_SYMBOL_CHECKED( dest, symbolName ) \
if ( ( LOAD_FREI0R_SYMBOL( dest, symbolName ) ) == NULL ) \
{ \
qCritical() << "Failed to load symbol:" << symbolName; \
vlmcCritical() << "Failed to load symbol:" << symbolName; \
return false; \
}
......@@ -87,12 +87,12 @@ Effect::load()
m_author = infos.author;
if ( m_type == Filter && m_f0r_update == NULL )
{
qCritical() << "Failed to load symbol f0r_update. Dropping module" << fileName();
vlmcCritical() << "Failed to load symbol f0r_update. Dropping module" << fileName();
return false;
}
if ( ( m_type == Mixer2 || m_type == Mixer3 ) && m_f0r_update2 == NULL )
{
qCritical() << "Failed to load symbol f0r_update2. Dropping module" << fileName();
vlmcCritical() << "Failed to load symbol f0r_update2. Dropping module" << fileName();
return false;
}
for ( qint32 i = 0; i < m_nbParams; ++i )
......
......@@ -25,8 +25,6 @@
#include "Effect.h"
#include <QtDebug>
EffectInstance::EffectInstance( Effect *effect ) :
m_effect( effect ),
m_width( 0 ),
......
......@@ -23,10 +23,10 @@
#include "Effect.h"
#include "EffectSettingValue.h"
#include "EffectInstance.h"
#include "VlmcDebug.h"
#include <QColor>
#include <QPoint>
#include <QtDebug>
EffectSettingValue::EffectSettingValue( Type type, EffectInstance* instance, quint32 index,
const char *name, const char *desc, Flags flags ) :
......@@ -91,7 +91,7 @@ EffectSettingValue::set( const QVariant &val )
break ;
}
default:
qCritical() << "Setting type" << m_type << "is not handled by the effects engine";
vlmcCritical() << "Setting type" << m_type << "is not handled by the effects engine";
break;
}
apply();
......@@ -151,7 +151,7 @@ EffectSettingValue::get()
break ;
}
default:
qCritical() << "Setting type" << m_type << "is not handled by the effects engine";
vlmcCritical() << "Setting type" << m_type << "is not handled by the effects engine";
m_val = QVariant();
}
return m_val;
......@@ -179,7 +179,7 @@ EffectSettingValue::frei0rToVlmc( int type )
case F0R_PARAM_STRING:
return String;
default:
qCritical() << "Invalid effect setting type ! Undefined behaviour";
vlmcCritical() << "Invalid effect setting type ! Undefined behaviour";
}
//Keeping compiler happy.
return Double;
......
......@@ -25,10 +25,10 @@
#include "EffectHelper.h"
#include "EffectInstance.h"
#include "Types.h"
#include "VlmcDebug.h"
#include <QDomElement>
#include <QReadWriteLock>
#include <QtDebug>
EffectUser::EffectUser() :
m_isRendering( false ),
......@@ -192,10 +192,10 @@ EffectUser::loadEffects( const QDomElement &parent )
EffectHelper *helper = addEffect( e, effect.attribute( "start" ).toLongLong(),
effect.attribute( "end" ).toLongLong() );
if ( helper == NULL )
qCritical() << "Can't load effect" << effect.attribute( "name" );
vlmcCritical() << "Can't load effect" << effect.attribute( "name" );
}
else
qCritical() << "Can't load effect" << effect.attribute( "name" );
vlmcCritical() << "Can't load effect" << effect.attribute( "name" );
}
effect = effect.nextSiblingElement();
}
......@@ -229,7 +229,7 @@ EffectUser::effects( Effect::Type type ) const
if ( type == Effect::Filter )
return m_filters;
if ( type != Effect::Mixer2 )
qCritical() << "Only Filters and Mixer2 are handled. This is going to be nasty !";
vlmcCritical() << "Only Filters and Mixer2 are handled. This is going to be nasty !";
return m_mixers;
}
......@@ -259,7 +259,7 @@ EffectUser::removeEffect( Effect::Type type, qint32 idx )
}
}
else
qCritical() << "Unhandled effect type";
vlmcCritical() << "Unhandled effect type";
}
void
......@@ -281,7 +281,7 @@ EffectUser::removeEffect(EffectHelper *helper)
}
++it;
}
qWarning() << "Can't find EffectHelper" << helper->uuid() << "for removal.";
vlmcWarning() << "Can't find EffectHelper" << helper->uuid() << "for removal.";
}
void
......@@ -305,7 +305,7 @@ EffectUser::count( Effect::Type type ) const
return m_filters.count();
if ( type == Effect::Mixer2 )
return m_mixers.count();
qCritical() << "Unhandled effect type";
vlmcCritical() << "Unhandled effect type";
return 0;
}
......@@ -324,7 +324,7 @@ EffectUser::moveEffect( EffectHelper *helper, qint64 newPos )
return ;
}
}
qWarning() << this << "Can't find effect" << helper->uuid();
vlmcWarning() << this << "Can't find effect" << helper->uuid();
}
void
......
......@@ -26,6 +26,8 @@
#include "EffectInstance.h"
#include "Types.h"
#include "VlmcDebug.h"
#include <QApplication>
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
......@@ -39,8 +41,6 @@
#include <QSettings>
#include <QXmlStreamWriter>
#include <QtDebug>
#ifdef Q_OS_WIN
#include <windows.h>
#endif
......@@ -89,7 +89,7 @@ EffectsEngine::loadEffect( const QString &fileName )
name = m_cache->value( fileName + "/name" ).toString();
int typeInt = m_cache->value( fileName + "/type" ).toInt();
if ( typeInt < Effect::Unknown || typeInt > Effect::Mixer3 )
qWarning() << "Invalid plugin type.";
vlmcWarning() << "Invalid plugin type.";
else
{
type = static_cast<Effect::Type>( typeInt );
......@@ -158,7 +158,7 @@ EffectsEngine::loadEffects()
TCHAR *pos = strrchr( appDir, '\\' );
if ( pos == NULL )
{
qWarning() << "Can't use ModuleFileName:" << appDir;
vlmcWarning() << "Can't use ModuleFileName:" << appDir;
return ;
}
*pos = 0;
......@@ -166,16 +166,16 @@ EffectsEngine::loadEffects()
}
else
{
qWarning() << "Failed to get application directory. Using current path.";
vlmcWarning() << "Failed to get application directory. Using current path.";
pathList << QDir::currentPath() + "/effects/";
}
#endif
qDebug() << "Loading effects from:" << pathList;
vlmcDebug() << "Loading effects from:" << pathList;
foreach ( const QString &path, pathList )
{
if ( QFile::exists( path ) == true )
{
qDebug() << "\tScanning" << path << "for effects";
vlmcDebug() << "\tScanning" << path << "for effects";
browseDirectory( path );
}
}
......
......@@ -19,7 +19,6 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QtDebug>
#include <QApplication>
#include <QMap>
#include <QMapIterator>
......
......@@ -30,12 +30,12 @@
#include <QUrl>
#include <QNetworkProxy>
#include <QSettings>
#include <QDebug>
#include "MainWindow.h"
#include "config.h"
#include "Library.h"
#include "About.h"
#include "VlmcDebug.h"
#include "VlmcLogger.h"
#include "EffectsEngine/EffectsEngine.h"
......@@ -755,7 +755,7 @@ MainWindow::toolButtonClicked( QAction *action )
else if ( action == m_ui.actionCut_mode )
emit toolChanged( TOOL_CUT );
else
qCritical() << "Unknown tool. This should not happen !";
vlmcCritical() << "Unknown tool. This should not happen !";
}
void
......
......@@ -29,8 +29,6 @@
#include <QApplication>
#include <QFontMetrics>
#include <QtDebug>
EffectInstanceListModel::EffectInstanceListModel( EffectUser *user ) :
m_user( user )
{
......
......@@ -34,8 +34,6 @@
#include <QLabel>
#include <QVBoxLayout>
#include <QtDebug>
EffectInstanceWidget::EffectInstanceWidget( QWidget *parent ) :
QWidget( parent ),
m_ui( new Ui::EffectSettingWidget )
......
......@@ -32,8 +32,6 @@
#include <QMimeData>
#include <QDrag>
#include <QtDebug>
EffectsListView::EffectsListView( QWidget *parent ) :
QListView(parent)
{
......
......@@ -23,14 +23,13 @@
#include "AbstractSharingService.h"
#include "SettingsManager.h"
#include "ShareOnInternet.h"
#include "VlmcDebug.h"
#include "YouTube/YouTubeService.h"
#include <QDesktopServices>
#include <QClipboard>
#include <QMessageBox>
#include <QDebug>
ShareOnInternet::ShareOnInternet( QWidget* parent )
: QDialog( parent, Qt::Sheet | Qt::Dialog )
{
......@@ -94,11 +93,11 @@ ShareOnInternet::publish()
switch( m_serviceProvider )
{
case VIMEO: /* TODO: Implement services for Vimeo */
qDebug() << "[SHARE ON INTERNET]: VIMEO"; break;
vlmcDebug() << "[SHARE ON INTERNET]: VIMEO"; break;
case YOUTUBE:
default:
m_service = new YouTubeService( m_devKey, getUsername(), getPassword() );
qDebug() << "[SHARE ON INTERNET]: YOUTUBE"; break;
vlmcDebug() << "[SHARE ON INTERNET]: YOUTUBE"; break;
}
}
else
......@@ -114,7 +113,7 @@ ShareOnInternet::publish()
void
ShareOnInternet::authFinished()
{
qDebug() << "[SHARE ON INTERNET]: AUTH FINISHED";
vlmcDebug() << "[SHARE ON INTERNET]: AUTH FINISHED";
/*On Finish, extract out the auth token and upload a test video */
disconnect( m_service, SIGNAL(authOver()), this, SLOT(authFinished()) );
......@@ -136,7 +135,7 @@ ShareOnInternet::authFinished()
this, SLOT(uploadProgress(qint64,qint64)) );
disconnect( m_service, SIGNAL(error(QString)), this, SLOT(serviceError(QString)) );
qDebug() << "[SHARE ON INTERNET]: AUTH Failed";
vlmcDebug() << "[SHARE ON INTERNET]: AUTH Failed";
return;
}
......@@ -145,13 +144,13 @@ ShareOnInternet::authFinished()
m_ui.progressBar->setVisible( true );
m_ui.mainPanel->setEnabled( false );
qDebug() << "[SHARE ON INTERNET]: UPLOAD STARTED";
vlmcDebug() << "[SHARE ON INTERNET]: UPLOAD STARTED";
}
void
ShareOnInternet::uploadFinished( QString result )
{
qDebug() << "[SHARE ON INTERNET]: UPLOAD FINISHED";
vlmcDebug() << "[SHARE ON INTERNET]: UPLOAD FINISHED";
/* Add code here to abort stuff */
m_ui.progressBar->setEnabled( false );
......
......@@ -36,6 +36,7 @@
#include "PreviewWidget.h"
#include "TagWidget.h"
#include "Transcoder.h"
#include "VlmcDebug.h"
#include <QFileSystemModel>
#include <QHeaderView>
......@@ -45,8 +46,6 @@
#include <QTime>
#include <QTimer>
#include <QtDebug>
ImportController::ImportController(QWidget *parent) :
QDialog(parent),
m_ui(new Ui::ImportController),
......@@ -152,7 +151,7 @@ ImportController::clipSelection( Clip* clip )
void
ImportController::importMedia( const QString &filePath )
{
qDebug() << "Importing" << filePath;
vlmcDebug() << "Importing" << filePath;
if ( Library::getInstance()->mediaAlreadyLoaded( filePath ) == true ||
m_temporaryMedias->mediaAlreadyLoaded( filePath ) == true )
return ;
......@@ -162,7 +161,7 @@ ImportController::importMedia( const QString &filePath )
media->computeMetadata();
if ( media == NULL )
{
qCritical() << "An error occurred while loading media:" << filePath;
vlmcCritical() << "An error occurred while loading media:" << filePath;
return ;
}
Clip* clip = new Clip( media );
......
......@@ -29,8 +29,8 @@
#include "MediaListView.h"
#include "StackViewController.h"
#include "ViewController.h"
#include "VlmcDebug.h"
#include <QDebug>
#include <QUrl>
#include <QMimeData>
......@@ -184,7 +184,7 @@ MediaLibrary::dropEvent( QDropEvent *event )
event->accept();
}
else
qCritical() << "Clip already present in library or an error occurred while loading media:" << fileName;
vlmcCritical() << "Clip already present in library or an error occurred while loading media:" << fileName;
}
event->accept();
}
......@@ -21,7 +21,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QDebug>
#include <QPainter>
#include <QPolygon>
#include <QBrush>
......
......@@ -29,7 +29,6 @@
#include "Clip.h"
#include <QMessageBox>
#include <QDebug>
PreviewWidget::PreviewWidget( QWidget *parent ) :
QWidget( parent ),
......
......@@ -33,8 +33,6 @@
#include <QMessageBox>
#include <QTimer>
#include <QtDebug>
GUIProjectManager::GUIProjectManager()
{
connect( this, SIGNAL( projectClosed() ), Library::getInstance(), SLOT( clear() ) );
......
......@@ -23,7 +23,6 @@
#include <QKeyEvent>
#include <QKeySequence>
#include <QTimer>
#include <QtDebug>
#include "SettingsManager.h"
#include "KeyboardShortcutInput.h"
......
......@@ -24,12 +24,12 @@
#include "LanguageWidget.h"
#include "SettingsManager.h"
#include "SettingValue.h"
#include "VlmcDebug.h"
#include <QApplication>
#include <QComboBox>
#include <QDir>
#include <QTranslator>
#include <QtDebug>
#define TS_PREFIX "vlmc_"
......@@ -47,7 +47,7 @@ LanguageWidget::LanguageWidget( SettingValue *s, QWidget *parent /*= NULL*/ ) :
if ( localePos < 0 || extPos < 0 || localePos > extPos )
{
qWarning() << "Invalid translation file:" << tsFileName;
vlmcWarning() << "Invalid translation file:" << tsFileName;
continue ;
}
......@@ -58,7 +58,7 @@ LanguageWidget::LanguageWidget( SettingValue *s, QWidget *parent /*= NULL*/ ) :
// Check if the country code is valid ISO 639
if ( locale.language() == QLocale::C )
{
qWarning() << "Invalid locale for file:" << tsFileName;
vlmcWarning() << "Invalid locale for file:" << tsFileName;
continue;
}
......
......@@ -35,7 +35,6 @@
#include "StringWidget.h"
#include <QFormLayout>
#include <QtDebug>
#include <QWidget>
#include <QLabel>
#include <QHash>
......
......@@ -37,8 +37,6 @@
#include <QScrollArea>
#include <QStackedLayout>
#include <QtDebug>
Settings::Settings( SettingsManager::Type type, QWidget *parent ) :
QDialog( parent ),
m_type( type )
......
......@@ -29,8 +29,6 @@
#include <QGraphicsSceneEvent>
#include <QtDebug>
AbstractGraphicsItem::AbstractGraphicsItem() :
m_tracksView( NULL ),
m_oldTrack( NULL ),
......
......@@ -36,7 +36,6 @@
#include <QGraphicsSceneContextMenuEvent>
#include <QCoreApplication>
#include <QtDebug>
AbstractGraphicsMediaItem::AbstractGraphicsMediaItem( Clip* clip ) :
m_muted( false )
......
......@@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QtDebug>
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QGraphicsSceneMouseEvent>
......
......@@ -38,8 +38,6 @@
#include <QMenu>
#include <QPainter>
#include <QtDebug>
GraphicsEffectItem::GraphicsEffectItem( Effect *effect ) :
m_effect( effect ),
m_effectHelper( NULL ),
......
......@@ -29,7 +29,6 @@
#include <QPainter>
#include <QLinearGradient>
#include <QDebug>
#include <QTime>
#include <QFontMetrics>
#include <QGraphicsSceneMouseEvent>
......
......@@ -25,8 +25,6 @@
#include "GraphicsTrack.h"
#include "MainWorkflow.h"
#include <QtDebug>
GraphicsTrack::GraphicsTrack( Workflow::TrackType type, quint32 trackNumber,
QGraphicsItem *parent ) :
QGraphicsWidget( parent ),
......
......@@ -28,14 +28,13 @@
#include "TracksScene.h"
#include "TracksControls.h"
#include "TracksRuler.h"
#include "VlmcDebug.h"
#include "WorkflowRenderer.h"
#include <QHBoxLayout>
#include <QDomElement>
#include <QScrollBar>
#include <QtDebug>
Timeline* Timeline::m_instance = NULL;
Timeline::Timeline( WorkflowRenderer* renderer, QWidget *parent ) :
......@@ -193,7 +192,7 @@ Timeline::load( const QDomElement &root )
QDomElement project = root.firstChildElement( "timeline" );
if ( project.isNull() == true )
{
qCritical() << "No timeline node in the project file";
vlmcCritical() << "No timeline node in the project file";
return ;
}
......@@ -225,7 +224,7 @@ Timeline::load( const QDomElement &root )
}
}
else
qWarning() << "No such timeline item:" << uuid;
vlmcWarning() << "No such timeline item:" << uuid;
elem = elem.nextSiblingElement();
}
}
......@@ -37,9 +37,10 @@
//Ugly part {
#include "Timeline.h"
#include "TracksRuler.h"
//} this should be fixed, it brokes the design
//} this should be fixed, it breaks the design
#include "TrackWorkflow.h"
#include "UndoStack.h"
#include "VlmcDebug.h"
#include "WorkflowRenderer.h"
#include <QGraphicsLinearLayout>
......@@ -50,8 +51,6 @@
#include <QWheelEvent>
#include <QMimeData>
#include <QtDebug>
TracksView::TracksView( QGraphicsScene *scene, MainWorkflow *mainWorkflow,
WorkflowRenderer *renderer, QWidget *parent )
: QGraphicsView( scene, parent ),
......@@ -367,7 +366,7 @@ TracksView::effectDragEnterEvent( QDragEnterEvent *event )
m_dragEffectItem->m_tracksView = this;
}
else
qWarning() << "Can't find effect name" << event->mimeData()->data( "vlmc/effect_name");
vlmcWarning() << "Can't find effect name" << event->mimeData()->data( "vlmc/effect_name");
}
void
......
......@@ -20,7 +20,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QDebug>
#include "OpenPage.h"
#include "project/GuiProjectManager.h"
#include "ProjectWizard.h"
......
......@@ -32,8 +32,6 @@
#include "GeneralPage.h"
#include "VideoPage.h"
#include <QtDebug>
ProjectWizard::ProjectWizard( QWidget* parent )
: QWizard( parent )
{
......
......@@ -32,7 +32,6 @@
#include <QMessageBox>
#include <QFileInfo>
#include <QSettings>
#include <QDebug>
QString* WelcomePage::m_projectPath = NULL;
......
......@@ -20,12 +20,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QtGlobal>
#include <QtDebug>
#include <cassert>
#include "VLCMediaPlayer.h"
#include "VLCInstance.h"
#include "VLCMedia.h"
#include "VlmcDebug.h"
#include <QtGlobal>
using namespace LibVLCpp;
......@@ -139,7 +139,7 @@ MediaPlayer::callbacks( const libvlc_event_t* event, void* ptr )
if (event->type != libvlc_MediaPlayerPositionChanged &&
event->type != libvlc_MediaPlayerTimeChanged)
{
qDebug() << self->m_name << "Event received:" << libvlc_event_type_name(event->type);
vlmcDebug() << self->m_name << "Event received:" << libvlc_event_type_name(event->type);
}
self->checkForWaitedEvents( event );
......@@ -162,7 +162,7 @@ MediaPlayer::callbacks( const libvlc_event_t* event, void* ptr )
self->emit timeChanged( event->u.media_player_time_changed.new_time );
break;
case libvlc_MediaPlayerPositionChanged:
//qDebug() << self << "position changed : " << event->u.media_player_position_changed.new_position;
//vlmcDebug() << self << "position changed : " << event->u.media_player_position_changed.new_position;
self->emit positionChanged( event->u.media_player_position_changed.new_position );
break;
case libvlc_MediaPlayerLengthChanged:
......@@ -186,7 +186,7 @@ MediaPlayer::callbacks( const libvlc_event_t* event, void* ptr )
case libvlc_MediaPlayerForward:
case libvlc_MediaPlayerBackward:
default:
// qDebug() << "Unknown mediaPlayerEvent: " << event->type;
// vlmcDebug() << "Unknown mediaPlayerEvent: " << event->type;
break;
}
}
......@@ -194,7 +194,7 @@ MediaPlayer::callbacks( const libvlc_event_t* event, void* ptr )
void
MediaPlayer::play()
{
//qDebug() << "Asking for play media player";
//vlmcDebug() << "Asking for play media player";
libvlc_media_player_play( m_internalPtr );
}
......@@ -207,7 +207,7 @@ MediaPlayer::pause()
void
MediaPlayer::stop()
{
//qDebug() << "Asking for stop media player";
//vlmcDebug() << "Asking for stop media player";
libvlc_media_player_stop( m_internalPtr );
}
......
......@@ -32,9 +32,9 @@
#include "Media.h"
#include "MetaDataManager.h"
#include "SettingsManager.h"
#include "VlmcDebug.h"
#include "Workspace.h"
#include <QtDebug>
#include <QDomElement>
#include <QHash>
#include <QUuid>
......@@ -70,7 +70,7 @@ Library::loadProject( const QDomElement& doc )
}
Media* m = addMedia( mrl );
if ( m == NULL )
qWarning() << "Failed to load media" << mrl << "when loading project.";
vlmcWarning() << "Failed to load media" << mrl << "when loading project.";
else
m_nbMediaToLoad.fetchAndAddAcquire( 1 );
}
......
......@@ -30,10 +30,9 @@
#include "Media.h"
#include "MetaDataManager.h"
#include "SettingsManager.h"
#include "VlmcDebug.h"
#include "Workspace.h"
#include <QtDebug>
MediaContainer::MediaContainer( Clip* parent /*= NULL*/ ) : m_parent( parent )
{
}
......@@ -112,7 +111,7 @@ MediaContainer::addClip( Clip* clip )
( clip->getMedia()->fileInfo() == c->getMedia()->fileInfo() &&
( clip->begin() == c->begin() && clip->end() == c->end() ) ) )