Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 648084fe rédigé par Kubat's avatar Kubat
Parcourir les fichiers

LOG: Update the objects that use the LOG API

parent acf722da
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -55,7 +55,7 @@ AboutWindow::LicenceLabel::LicenceLabel(QWidget *parent, const QString &url, ...@@ -55,7 +55,7 @@ AboutWindow::LicenceLabel::LicenceLabel(QWidget *parent, const QString &url,
const Qt::TextFormat format) const Qt::TextFormat format)
: QTextEdit(parent) : QTextEdit(parent)
{ {
VIVY_LOG_CTOR() << "Creating label for licence '" << url << '\''; VIVY_LOG_CTOR() << "Creating label for licence " << VIVY_LOG_QUOTED(url);
QFile content(url); QFile content(url);
if (!content.open(QIODevice::ReadOnly | QIODevice::Text)) if (!content.open(QIODevice::ReadOnly | QIODevice::Text))
throw std::runtime_error("Failed to open file that should be accessible"); throw std::runtime_error("Failed to open file that should be accessible");
......
...@@ -300,7 +300,8 @@ MainWindow::closeDocument(int index) noexcept ...@@ -300,7 +300,8 @@ MainWindow::closeDocument(int index) noexcept
&MainWindow::documentViewActionsChanged); &MainWindow::documentViewActionsChanged);
if (documentToClose) { if (documentToClose) {
logDebug() << "Delete document view " << documentToClose->getDocumentTabName(); logDebug()
<< "Delete document view " << VIVY_LOG_QUOTED(documentToClose->getDocumentTabName());
documentToClose->closeDocument(); documentToClose->closeDocument();
delete documentToClose; delete documentToClose;
} }
...@@ -331,7 +332,7 @@ MainWindow::openDocument() noexcept ...@@ -331,7 +332,7 @@ MainWindow::openDocument() noexcept
Utils::DocumentType fileType; Utils::DocumentType fileType;
if (!Utils::detectDocumentType(fileInfo, &fileType)) { if (!Utils::detectDocumentType(fileInfo, &fileType)) {
logWarning() << "Failed to detect file type for " << filename; logWarning() << "Failed to detect file type for " << VIVY_LOG_QUOTED(filename);
return; return;
} }
...@@ -353,7 +354,8 @@ MainWindow::openDocument() noexcept ...@@ -353,7 +354,8 @@ MainWindow::openDocument() noexcept
addTab(newView); addTab(newView);
} }
} catch (const std::runtime_error &e) { } catch (const std::runtime_error &e) {
logError() << "Failed to load document " << filename << " with error: " << e.what(); logError() << "Failed to load document " << VIVY_LOG_QUOTED(filename)
<< " with error: " << e.what();
} }
} }
...@@ -515,7 +517,8 @@ MainWindow::executeDialog(MainWindow *const self, QFileDialog *const dialog) noe ...@@ -515,7 +517,8 @@ MainWindow::executeDialog(MainWindow *const self, QFileDialog *const dialog) noe
const QStringList resList = dialog->selectedFiles(); const QStringList resList = dialog->selectedFiles();
if (resList.size() != 1) { if (resList.size() != 1) {
self->logError() << "You must select only one file"; self->logError()
<< "You must select only one file, here got " << resList.size() << " files";
return QStringLiteral(""); return QStringLiteral("");
} }
......
...@@ -6,7 +6,7 @@ using namespace Vivy; ...@@ -6,7 +6,7 @@ using namespace Vivy;
VivyApplication::VivyApplication(int &argc, char **argv) VivyApplication::VivyApplication(int &argc, char **argv)
: QApplication(argc, argv) : QApplication(argc, argv)
{ {
VIVY_LOG_CTOR(VivyApplication) << "Construction is OK"; VIVY_LOG_CTOR() << "Construction is OK";
} }
void void
...@@ -27,7 +27,7 @@ VivyApplication::setTheme(Theme theme) noexcept ...@@ -27,7 +27,7 @@ VivyApplication::setTheme(Theme theme) noexcept
stylesheet.open(QFile::ReadOnly | QFile::Text); stylesheet.open(QFile::ReadOnly | QFile::Text);
QTextStream stylesheetStream(&stylesheet); QTextStream stylesheetStream(&stylesheet);
setStyleSheet(stylesheetStream.readAll()); setStyleSheet(stylesheetStream.readAll());
logInfo() << "Theme set using " << sheet; logInfo() << "Theme set using " << VIVY_LOG_QUOTED(sheet);
} }
flushLogSink(); flushLogSink();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter