summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/base/bootloaderinstallams.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/bootloaderinstallams.cpp
parent335ec75d60bba82f23fc47b20f9390e0cba9c9c5 (diff)
downloadrockbox-4d2ce949b3b41f8bf0af446fa20205ddd229e579.tar.gz
rockbox-4d2ce949b3b41f8bf0af446fa20205ddd229e579.zip
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/bootloaderinstallams.cpp')
-rw-r--r--rbutil/rbutilqt/base/bootloaderinstallams.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/rbutil/rbutilqt/base/bootloaderinstallams.cpp b/rbutil/rbutilqt/base/bootloaderinstallams.cpp
index dbdac8e2ce..33ad51c200 100644
--- a/rbutil/rbutilqt/base/bootloaderinstallams.cpp
+++ b/rbutil/rbutilqt/base/bootloaderinstallams.cpp
@@ -19,6 +19,7 @@
19#include <QtCore> 19#include <QtCore>
20#include "bootloaderinstallbase.h" 20#include "bootloaderinstallbase.h"
21#include "bootloaderinstallams.h" 21#include "bootloaderinstallams.h"
22#include "Logger.h"
22 23
23#include "../mkamsboot/mkamsboot.h" 24#include "../mkamsboot/mkamsboot.h"
24 25
@@ -51,7 +52,7 @@ bool BootloaderInstallAms::install(void)
51 if(m_offile.isEmpty()) 52 if(m_offile.isEmpty())
52 return false; 53 return false;
53 54
54 qDebug() << "[BootloaderInstallAms] installing bootloader"; 55 LOG_INFO() << "installing bootloader";
55 56
56 // download firmware from server 57 // download firmware from server
57 emit logItem(tr("Downloading bootloader file"), LOGINFO); 58 emit logItem(tr("Downloading bootloader file"), LOGINFO);
@@ -64,7 +65,7 @@ bool BootloaderInstallAms::install(void)
64 65
65void BootloaderInstallAms::installStage2(void) 66void BootloaderInstallAms::installStage2(void)
66{ 67{
67 qDebug() << "[BootloaderInstallAms] installStage2"; 68 LOG_INFO() << "installStage2";
68 69
69 unsigned char* buf; 70 unsigned char* buf;
70 unsigned char* of_packed; 71 unsigned char* of_packed;
@@ -94,7 +95,7 @@ void BootloaderInstallAms::installStage2(void)
94 errstr,sizeof(errstr)); 95 errstr,sizeof(errstr));
95 if (rb_packed == NULL) 96 if (rb_packed == NULL)
96 { 97 {
97 qDebug() << "[BootloaderInstallAms] could not load bootloader: " << bootfile; 98 LOG_ERROR() << "could not load bootloader: " << bootfile;
98 emit logItem(errstr, LOGERROR); 99 emit logItem(errstr, LOGERROR);
99 emit logItem(tr("Could not load %1").arg(bootfile), LOGERROR); 100 emit logItem(tr("Could not load %1").arg(bootfile), LOGERROR);
100 emit done(true); 101 emit done(true);
@@ -107,7 +108,7 @@ void BootloaderInstallAms::installStage2(void)
107 errstr, sizeof(errstr)); 108 errstr, sizeof(errstr));
108 if (buf == NULL) 109 if (buf == NULL)
109 { 110 {
110 qDebug() << "[BootloaderInstallAms] could not load OF: " << m_offile; 111 LOG_ERROR() << "could not load OF: " << m_offile;
111 emit logItem(errstr, LOGERROR); 112 emit logItem(errstr, LOGERROR);
112 emit logItem(tr("Could not load %1").arg(m_offile), LOGERROR); 113 emit logItem(tr("Could not load %1").arg(m_offile), LOGERROR);
113 free(rb_packed); 114 free(rb_packed);
@@ -121,7 +122,7 @@ void BootloaderInstallAms::installStage2(void)
121 122
122 if (!patchable) 123 if (!patchable)
123 { 124 {
124 qDebug() << "[BootloaderInstallAms] No room to insert bootloader"; 125 LOG_ERROR() << "No room to insert bootloader";
125 emit logItem(errstr, LOGERROR); 126 emit logItem(errstr, LOGERROR);
126 emit logItem(tr("No room to insert bootloader, try another firmware version"), 127 emit logItem(tr("No room to insert bootloader, try another firmware version"),
127 LOGERROR); 128 LOGERROR);
@@ -143,7 +144,7 @@ void BootloaderInstallAms::installStage2(void)
143 144
144 if(!out.open(QIODevice::WriteOnly | QIODevice::Truncate)) 145 if(!out.open(QIODevice::WriteOnly | QIODevice::Truncate))
145 { 146 {
146 qDebug() << "[BootloaderInstallAms] Could not open" << m_blfile << "for writing"; 147 LOG_ERROR() << "Could not open" << m_blfile << "for writing";
147 emit logItem(tr("Could not open %1 for writing").arg(m_blfile),LOGERROR); 148 emit logItem(tr("Could not open %1 for writing").arg(m_blfile),LOGERROR);
148 free(buf); 149 free(buf);
149 free(of_packed); 150 free(of_packed);
@@ -156,7 +157,7 @@ void BootloaderInstallAms::installStage2(void)
156 157
157 if (n != len) 158 if (n != len)
158 { 159 {
159 qDebug() << "[BootloaderInstallAms] Could not write firmware file"; 160 LOG_ERROR() << "Could not write firmware file";
160 emit logItem(tr("Could not write firmware file"),LOGERROR); 161 emit logItem(tr("Could not write firmware file"),LOGERROR);
161 free(buf); 162 free(buf);
162 free(of_packed); 163 free(of_packed);
@@ -172,7 +173,7 @@ void BootloaderInstallAms::installStage2(void)
172 free(rb_packed); 173 free(rb_packed);
173 174
174 //end of install 175 //end of install
175 qDebug() << "[BootloaderInstallAms] install successfull"; 176 LOG_INFO() << "install successfull";
176 emit logItem(tr("Success: modified firmware file created"), LOGINFO); 177 emit logItem(tr("Success: modified firmware file created"), LOGINFO);
177 logInstall(LogAdd); 178 logInstall(LogAdd);
178 emit done(false); 179 emit done(false);