summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2013-11-03 11:08:18 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2013-11-04 23:32:52 +0100
commit4d2ce949b3b41f8bf0af446fa20205ddd229e579 (patch)
tree01fa19471d9831b296bea5d7049f765e38b30bbb /rbutil/rbutilqt/base/bootloaderinstallbase.cpp
parent335ec75d60bba82f23fc47b20f9390e0cba9c9c5 (diff)
downloadrockbox-4d2ce949b3b41f8bf0af446fa20205ddd229e579.zip
rockbox-4d2ce949b3b41f8bf0af446fa20205ddd229e579.tar.gz
rockbox-4d2ce949b3b41f8bf0af446fa20205ddd229e579.tar.bz2
rockbox-4d2ce949b3b41f8bf0af446fa20205ddd229e579.tar.xz
Use cutelogger for Rockbox Utility internal trace.
Change tracing from qDebug() to use cutelogger, which is available under the LGPL2.1. This allows to automatically add filename and line number to the log, and also provides multiple log levels. Change-Id: I5dbdaf902ba54ea99f07ae10a07467c52fdac910
Diffstat (limited to 'rbutil/rbutilqt/base/bootloaderinstallbase.cpp')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallbase.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
index 1a47f96..9a1c74c 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallbase.cpp
@@ -23,6 +23,7 @@
#include "utils.h"
#include "ziputil.h"
#include "mspackutil.h"
+#include "Logger.h"
#if defined(Q_OS_MACX)
#include <sys/param.h>
@@ -58,8 +59,8 @@ void BootloaderInstallBase::downloadBlStart(QUrl source)
void BootloaderInstallBase::downloadReqFinished(int id, bool error)
{
- qDebug() << "[BootloaderInstallBase] Download Request" << id
- << "finished, error:" << m_http.errorString();
+ LOG_INFO() << "Download Request" << id
+ << "finished, error:" << m_http.errorString();
downloadBlFinish(error);
}
@@ -67,8 +68,8 @@ void BootloaderInstallBase::downloadReqFinished(int id, bool error)
void BootloaderInstallBase::downloadBlFinish(bool error)
{
- qDebug() << "[BootloaderInstallBase] Downloading bootloader finished, error:"
- << error;
+ LOG_INFO() << "Downloading bootloader finished, error:"
+ << error;
// update progress bar
emit logProgress(100, 100);
@@ -98,7 +99,7 @@ void BootloaderInstallBase::downloadBlFinish(bool error)
void BootloaderInstallBase::installBlfile(void)
{
- qDebug() << "[BootloaderInstallBase] installBlFile(void)";
+ LOG_INFO() << "installBlFile(void)";
}
@@ -107,7 +108,7 @@ void BootloaderInstallBase::installBlfile(void)
//! @return true on success, false on error.
bool BootloaderInstallBase::backup(QString to)
{
- qDebug() << "[BootloaderInstallBase] Backing up bootloader file";
+ LOG_INFO() << "Backing up bootloader file";
QDir targetDir(".");
emit logItem(tr("Creating backup of original firmware file."), LOGINFO);
if(!targetDir.mkpath(to)) {
@@ -115,7 +116,7 @@ bool BootloaderInstallBase::backup(QString to)
return false;
}
QString tofile = to + "/" + QFileInfo(m_blfile).fileName();
- qDebug() << "[BootloaderInstallBase] trying to backup" << m_blfile << "to" << tofile;
+ LOG_INFO() << "trying to backup" << m_blfile << "to" << tofile;
if(!QFile::copy(Utils::resolvePathCase(m_blfile), tofile)) {
emit logItem(tr("Creating backup copy failed."), LOGERROR);
return false;
@@ -137,8 +138,8 @@ int BootloaderInstallBase::logInstall(LogMode mode)
if(mode == LogAdd) {
s.setValue("Bootloader/" + section, m_blversion.toString(Qt::ISODate));
- qDebug() << "[BootloaderInstallBase] Writing log, version:"
- << m_blversion.toString(Qt::ISODate);
+ LOG_INFO() << "Writing log, version:"
+ << m_blversion.toString(Qt::ISODate);
}
else {
s.remove("Bootloader/" + section);
@@ -182,7 +183,7 @@ void BootloaderInstallBase::checkRemount()
if(!status) {
// still not remounted, restart timer.
QTimer::singleShot(500, this, SLOT(checkRemount()));
- qDebug() << "[BootloaderInstallBase] Player not remounted yet" << m_remountDevice;
+ LOG_INFO() << "Player not remounted yet" << m_remountDevice;
}
else {
emit logItem(tr("Player remounted"), LOGINFO);
@@ -244,11 +245,11 @@ bool BootloaderInstallBase::setOfFile(QString of, QStringList blfile)
// check if the file set is in zip format
if(util) {
QStringList contents = util->files();
- qDebug() << "[BootloaderInstallBase] archive contains:" << contents;
+ LOG_INFO() << "archive contains:" << contents;
for(int i = 0; i < blfile.size(); ++i) {
// strip any path, we don't know the structure in the zip
QString f = QFileInfo(blfile.at(i)).fileName();
- qDebug() << "[BootloaderInstallBase] searching archive for" << f;
+ LOG_INFO() << "searching archive for" << f;
// contents.indexOf() works case sensitive. Since the filename
// casing is unknown (and might change) do this manually.
// FIXME: support files in folders