1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dominik Riebeling 2013-11-03 11:08:18 +01:00
parent 335ec75d60
commit 4d2ce949b3
65 changed files with 2420 additions and 455 deletions

View file

@ -21,6 +21,7 @@
#include <QtDebug>
#include "bootloaderinstallmi4.h"
#include "utils.h"
#include "Logger.h"
BootloaderInstallMi4::BootloaderInstallMi4(QObject *parent)
: BootloaderInstallBase(parent)
@ -31,7 +32,7 @@ BootloaderInstallMi4::BootloaderInstallMi4(QObject *parent)
bool BootloaderInstallMi4::install(void)
{
emit logItem(tr("Downloading bootloader"), LOGINFO);
qDebug() << "[BootloaderInstallMi4] installing bootloader";
LOG_INFO() << "installing bootloader";
downloadBlStart(m_blurl);
connect(this, SIGNAL(downloadDone()), this, SLOT(installStage2()));
return true;
@ -48,18 +49,18 @@ void BootloaderInstallMi4::installStage2(void)
QString moved = QFileInfo(Utils::resolvePathCase(m_blfile)).absolutePath()
+ "/OF.mi4";
if(!QFileInfo(moved).exists()) {
qDebug() << "[BootloaderInstallMi4] renaming" << fwfile << "to" << moved;
LOG_INFO() << "renaming" << fwfile << "to" << moved;
oldbl.rename(moved);
}
else {
qDebug() << "[BootloaderInstallMi4] OF.mi4 already present, not renaming again.";
LOG_INFO() << "OF.mi4 already present, not renaming again.";
oldbl.remove();
}
// place new bootloader
m_tempfile.open();
qDebug() << "[BootloaderInstallMi4] renaming" << m_tempfile.fileName()
<< "to" << fwfile;
LOG_INFO() << "renaming" << m_tempfile.fileName()
<< "to" << fwfile;
m_tempfile.close();
if(!Utils::resolvePathCase(fwfile).isEmpty()) {
emit logItem(tr("A firmware file is already present on player"), LOGERROR);
@ -84,7 +85,7 @@ void BootloaderInstallMi4::installStage2(void)
bool BootloaderInstallMi4::uninstall(void)
{
qDebug() << "[BootloaderInstallMi4] Uninstalling bootloader";
LOG_INFO() << "Uninstalling bootloader";
// check if it's actually a Rockbox bootloader
emit logItem(tr("Checking for Rockbox bootloader"), LOGINFO);
@ -128,7 +129,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallMi4::installed(void)
QString resolved;
resolved = Utils::resolvePathCase(m_blfile);
if(resolved.isEmpty()) {
qDebug() << "[BootloaderInstallMi4] installed: BootloaderNone";
LOG_INFO() << "installed: BootloaderNone";
return BootloaderNone;
}
@ -140,11 +141,11 @@ BootloaderInstallBase::BootloaderType BootloaderInstallMi4::installed(void)
f.close();
if(!memcmp(magic, "RBBL", 4)) {
qDebug() << "[BootloaderInstallMi4] installed: BootloaderRockbox";
LOG_INFO() << "installed: BootloaderRockbox";
return BootloaderRockbox;
}
else {
qDebug() << "[BootloaderInstallMi4] installed: BootloaderOther";
LOG_INFO() << "installed: BootloaderOther";
return BootloaderOther;
}
}
@ -152,7 +153,7 @@ BootloaderInstallBase::BootloaderType BootloaderInstallMi4::installed(void)
BootloaderInstallBase::Capabilities BootloaderInstallMi4::capabilities(void)
{
qDebug() << "[BootloaderInstallMi4] getting capabilities";
LOG_INFO() << "getting capabilities";
return Install | Uninstall | Backup | IsFile | CanCheckInstalled | CanCheckVersion;
}