Skip to content

Commit

Permalink
Cleanup logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
kriben committed May 10, 2024
1 parent 74c04c9 commit 705fa5f
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 177 deletions.
10 changes: 6 additions & 4 deletions ApplicationLibCode/Application/RiaFileDownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <QNetworkReply>
#include <QNetworkRequest>

#include "RiaLogging.h"

RiaFileDownloader::RiaFileDownloader( QObject* parent )
: QObject( parent )
{
Expand All @@ -17,7 +19,7 @@ void RiaFileDownloader::downloadFile( const QUrl& url, const QString& filePath )
QNetworkAccessManager* manager = new QNetworkAccessManager( this );
QNetworkRequest request( url );

qDebug() << "Downloading from:" << url;
RiaLogging::debug( "Downloading from: " + url.toString() );

QNetworkReply* reply = manager->get( request );

Expand All @@ -27,7 +29,7 @@ void RiaFileDownloader::downloadFile( const QUrl& url, const QString& filePath )
{
if ( reply->error() )
{
qDebug() << "Download failed:" << reply->errorString();
RiaLogging::error( "Download failed:" + reply->errorString() );
emit done();
}
else
Expand All @@ -37,12 +39,12 @@ void RiaFileDownloader::downloadFile( const QUrl& url, const QString& filePath )
{
file.write( reply->readAll() );
file.close();
qDebug() << "Download succeeded. File saved to" << filePath;
RiaLogging::info( "Download succeeded. File saved to " + filePath );
emit done();
}
else
{
qDebug() << "Failed to save file to" << filePath;
RiaLogging::info( "Failed to save file to " + filePath );
emit done();
}
}
Expand Down

0 comments on commit 705fa5f

Please sign in to comment.