Improve logging
This commit is contained in:
+9
-9
@@ -35,7 +35,7 @@ bool Database::init(const QLatin1String &connectionName)
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Could not open NGC database";
|
||||
qWarning() << "Could not open NGC database";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ bool Database::init(const QLatin1String &connectionName)
|
||||
}
|
||||
if(version > 2)
|
||||
{
|
||||
qDebug() << "Database version is too new";
|
||||
qWarning() << "Database version is too new";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -100,16 +100,16 @@ bool Database::init(const QLatin1String &connectionName)
|
||||
m_deleteFile.prepare("DELETE FROM fits_files WHERE id=?");
|
||||
return true;
|
||||
}
|
||||
qDebug() << error.text();
|
||||
qWarning() << error.text();
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Failed to open database" << connectionName;
|
||||
qWarning() << "Failed to open database" << connectionName;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qDebug() << "Database is invalid";
|
||||
qWarning() << "Database is invalid";
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ bool Database::checkError(QSqlQuery &query)
|
||||
return true;
|
||||
else
|
||||
{
|
||||
qDebug() << error.text();
|
||||
qWarning() << error.text();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -383,7 +383,7 @@ bool Database::indexFile(const QFileInfo &file)
|
||||
m_insertFileWcs.bindValue(7, crVal2);
|
||||
if(!m_insertFileWcs.exec())
|
||||
{
|
||||
qDebug() << "Database error" << m_insertFileWcs.lastError();
|
||||
qWarning() << "Database error" << m_insertFileWcs.lastError();
|
||||
return false;
|
||||
}
|
||||
last_id = m_insertFileWcs.lastInsertId().toLongLong();
|
||||
@@ -394,7 +394,7 @@ bool Database::indexFile(const QFileInfo &file)
|
||||
m_insertFile.bindValue(1, mtime);
|
||||
if(!m_insertFile.exec())
|
||||
{
|
||||
qDebug() << "Database error" << m_insertFile.lastError();
|
||||
qWarning() << "Database error" << m_insertFile.lastError();
|
||||
return false;
|
||||
}
|
||||
last_id = m_insertFile.lastInsertId().toLongLong();
|
||||
@@ -415,7 +415,7 @@ bool Database::indexFile(const QFileInfo &file)
|
||||
m_insertFitsHeader.bindValue(3, comments);
|
||||
if(!m_insertFitsHeader.execBatch())
|
||||
{
|
||||
qDebug() << "Database error" << m_insertFitsHeader.lastError();
|
||||
qWarning() << "Database error" << m_insertFitsHeader.lastError();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -154,7 +154,7 @@ void ImageWidgetGL::setImage(std::shared_ptr<RawImage> image, int index)
|
||||
m_image->bind();
|
||||
f->glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
f->glGenerateMipmap(GL_TEXTURE_2D);
|
||||
qDebug() << "setImage" << timer.elapsed();
|
||||
qDebug() << "ImageWidgetGL::setImage" << timer.elapsed() << "ms";
|
||||
m_swPaint = f->glGetError() != GL_NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -721,19 +721,19 @@ void ImageWidgetGL::initializeGL()
|
||||
logger->startLogging();
|
||||
connect(logger, &QOpenGLDebugLogger::messageLogged, [](const QOpenGLDebugMessage &message)
|
||||
{
|
||||
qDebug() << message;
|
||||
qDebug() << "OpenGL debug" << message;
|
||||
});
|
||||
|
||||
qDebug() << "Vendor:" << (char*)f->glGetString(GL_VENDOR);
|
||||
qDebug() << "Renderer:" << (char*)f->glGetString(GL_RENDERER);
|
||||
qDebug() << "Version:" << (char*)f->glGetString(GL_VERSION);
|
||||
qDebug() << "OpenGL Vendor:" << (char*)f->glGetString(GL_VENDOR);
|
||||
qDebug() << "OpenGL Renderer:" << (char*)f->glGetString(GL_RENDERER);
|
||||
qDebug() << "OpenGL Version:" << (char*)f->glGetString(GL_VERSION);
|
||||
f->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &m_maxTextureSize);
|
||||
f->glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &m_maxArrayLayers);
|
||||
qDebug() << "Max texture size:" << m_maxTextureSize << "max layers:" << m_maxArrayLayers;
|
||||
|
||||
//MANUAL_MIPMAP_GEN = QString((const char*)f->glGetString(GL_VENDOR)).startsWith("ATI Technologies Inc", Qt::CaseInsensitive);
|
||||
|
||||
qDebug() << context()->format();
|
||||
qDebug() << "OpenGL context format" << context()->format();
|
||||
|
||||
// each vertex is x,y 2D position and s,t texture coordinates
|
||||
float vertexs[] = {-1.0f, -1.0f, 0.0f, 1.0f,
|
||||
|
||||
+7
-7
@@ -95,7 +95,7 @@ bool loadFITS(const QString path, ImageInfoData &info, std::shared_ptr<RawImage>
|
||||
char err[100];
|
||||
fits_get_errstatus(status, err);
|
||||
info.info.append({QObject::tr("Error"), QString(err)});
|
||||
qDebug() << "Failed to load FITS file" << err;
|
||||
qWarning() << "Failed to load FITS file" << err;
|
||||
return false;
|
||||
};
|
||||
|
||||
@@ -335,7 +335,7 @@ bool loadXISF(const QString &path, ImageInfoData &info, std::shared_ptr<RawImage
|
||||
catch (LibXISF::Error &err)
|
||||
{
|
||||
info.info.append(QPair<QString, QString>("Error", err.what()));
|
||||
qDebug() << "Failed to load XISF" << err.what();
|
||||
qWarning() << "Failed to load XISF" << err.what();
|
||||
return false;
|
||||
}
|
||||
info.info.append({QObject::tr("Error"), QObject::tr("Unsupported sample format")});
|
||||
@@ -382,7 +382,7 @@ bool readXISFHeader(const QString &path, ImageInfoData &info)
|
||||
}
|
||||
catch (LibXISF::Error &err)
|
||||
{
|
||||
qDebug() << err.what();
|
||||
qWarning() << "LibXISF error" << err.what();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -455,17 +455,17 @@ bool loadImage(const QString &path, ImageInfoData &info, std::shared_ptr<RawImag
|
||||
if(path.endsWith(".CR2", Qt::CaseInsensitive) || path.endsWith(".CR3", Qt::CaseInsensitive) || path.endsWith(".NEF", Qt::CaseInsensitive) || path.endsWith(".DNG", Qt::CaseInsensitive))
|
||||
{
|
||||
ret = loadRAW(path, info, rawImage);
|
||||
qDebug() << "LoadRAW" << timer.elapsed();
|
||||
qDebug() << "LoadRAW" << timer.elapsed() << "ms";
|
||||
}
|
||||
else if(isFITS(fileInfo.suffix()))
|
||||
{
|
||||
ret = loadFITS(path, info, rawImage, planar, index);
|
||||
qDebug() << "LoadFITS" << timer.elapsed();
|
||||
qDebug() << "LoadFITS" << timer.elapsed() << "ms";
|
||||
}
|
||||
else if(isXISF(fileInfo.suffix()))
|
||||
{
|
||||
ret = loadXISF(path, info, rawImage, planar, index);
|
||||
qDebug() << "LoadXISF" << timer.elapsed();
|
||||
qDebug() << "LoadXISF" << timer.elapsed() << "ms";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -481,7 +481,7 @@ bool loadImage(const QString &path, ImageInfoData &info, std::shared_ptr<RawImag
|
||||
exif_data_free(exif);
|
||||
}
|
||||
rawImage = std::make_shared<RawImage>(img);
|
||||
qDebug() << "LoadQImage" << timer.elapsed();
|
||||
qDebug() << "LoadQImage" << timer.elapsed() << "ms";
|
||||
ret = !img.isNull();
|
||||
}
|
||||
return ret;
|
||||
|
||||
+1
-1
@@ -835,7 +835,7 @@ void MainWindow::checkNewVersion()
|
||||
if(QMessageBox::question(this, tr("Update check"), tr("New version %1 is available. Do you want to download it now?").arg(tag)) == QMessageBox::Yes)
|
||||
{
|
||||
QUrl url(json.object().value("html_url").toString());
|
||||
qDebug() << url;
|
||||
qDebug() << "Opening url" << url;
|
||||
if(url.host() == "gitea.nouspiro.space")
|
||||
QDesktopServices::openUrl(url);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user