diff options
| author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-11-03 11:08:18 +0100 |
|---|---|---|
| committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-11-04 23:32:52 +0100 |
| commit | 4d2ce949b3b41f8bf0af446fa20205ddd229e579 (patch) | |
| tree | 01fa19471d9831b296bea5d7049f765e38b30bbb /rbutil/rbutilqt/base/bootloaderinstallimx.cpp | |
| parent | 335ec75d60bba82f23fc47b20f9390e0cba9c9c5 (diff) | |
| download | rockbox-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/bootloaderinstallimx.cpp')
| -rw-r--r-- | rbutil/rbutilqt/base/bootloaderinstallimx.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallimx.cpp b/rbutil/rbutilqt/base/bootloaderinstallimx.cpp index e12849e..74c6f94 100644 --- a/rbutil/rbutilqt/base/bootloaderinstallimx.cpp +++ b/rbutil/rbutilqt/base/bootloaderinstallimx.cpp @@ -21,6 +21,7 @@ #include "bootloaderinstallbase.h" #include "bootloaderinstallimx.h" #include "../mkimxboot/mkimxboot.h" +#include "Logger.h" // class for running mkimxboot() in a separate thread to keep the UI responsive. class BootloaderThreadImx : public QThread @@ -45,7 +46,7 @@ class BootloaderThreadImx : public QThread void BootloaderThreadImx::run(void) { - qDebug() << "[BootloaderThreadImx] Thread started."; + LOG_INFO() << "Thread started."; struct imx_option_t opt; memset(&opt, 0, sizeof(opt)); opt.debug = false; @@ -55,7 +56,7 @@ void BootloaderThreadImx::run(void) m_error = mkimxboot(m_inputfile.toLocal8Bit().constData(), m_bootfile.toLocal8Bit().constData(), m_outputfile.toLocal8Bit().constData(), opt); - qDebug() << "[BootloaderThreadImx] Thread finished, result:" << m_error; + LOG_INFO() << "Thread finished, result:" << m_error; } @@ -88,13 +89,13 @@ bool BootloaderInstallImx::install(void) { if(!QFileInfo(m_offile).isReadable()) { - qDebug() << "[BootloaderInstallImx] could not read original firmware file" + LOG_ERROR() << "could not read original firmware file" << m_offile; emit logItem(tr("Could not read original firmware file"), LOGERROR); return false; } - qDebug() << "[BootloaderInstallImx] downloading bootloader"; + LOG_INFO() << "downloading bootloader"; // download bootloader from server emit logItem(tr("Downloading bootloader file"), LOGINFO); connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2())); @@ -105,7 +106,7 @@ bool BootloaderInstallImx::install(void) void BootloaderInstallImx::installStage2(void) { - qDebug() << "[BootloaderInstallImx] patching file..."; + LOG_INFO() << "patching file..."; emit logItem(tr("Patching file..."), LOGINFO); m_tempfile.open(); @@ -132,26 +133,26 @@ void BootloaderInstallImx::installStage3(void) // if the patch failed if (err != IMX_SUCCESS) { - qDebug() << "[BootloaderInstallImx] Could not patch the original firmware file"; + LOG_ERROR() << "Could not patch the original firmware file"; emit logItem(tr("Patching the original firmware failed"), LOGERROR); emit done(true); return; } - qDebug() << "[BootloaderInstallImx] Original Firmware succesfully patched"; + LOG_INFO() << "Original Firmware succesfully patched"; emit logItem(tr("Succesfully patched firmware file"), LOGINFO); // if a bootloader is already present delete it. QString fwfile(m_blfile); if(QFileInfo(fwfile).isFile()) { - qDebug() << "[BootloaderInstallImx] deleting old target file"; + LOG_INFO() << "deleting old target file"; QFile::remove(fwfile); } // place (new) bootloader. Copy, since the temporary file will be removed // automatically. - qDebug() << "[BootloaderInstallImx] moving patched bootloader to" << fwfile; + LOG_INFO() << "moving patched bootloader to" << fwfile; if(m_patchedFile.copy(fwfile)) { emit logItem(tr("Bootloader successful installed"), LOGOK); |