Do not print debug logs by default
This commit is contained in:
@@ -337,7 +337,7 @@ void BatchProcessing::newMessageCli(const QString &message, bool error)
|
||||
if(error)
|
||||
qWarning() << message;
|
||||
else
|
||||
qDebug() << message;
|
||||
qInfo() << message;
|
||||
}
|
||||
|
||||
QJSValue BatchProcessing::getString(const QString &label, const QString &text)
|
||||
|
||||
@@ -447,7 +447,7 @@ DatabaseTreeView::DatabaseTreeView(Database *database, QWidget *parent) : QWidge
|
||||
,_database(database)
|
||||
{
|
||||
QVBoxLayout *vlayout = new QVBoxLayout(this);
|
||||
QHBoxLayout *hlayout = new QHBoxLayout(this);
|
||||
QHBoxLayout *hlayout = new QHBoxLayout;
|
||||
|
||||
_model = new DatabaseTree(database, this);
|
||||
_treeView = new QTreeView(this);
|
||||
@@ -473,7 +473,7 @@ DatabaseTreeView::DatabaseTreeView(Database *database, QWidget *parent) : QWidge
|
||||
connect(_filters, &QComboBox::currentIndexChanged, this, &DatabaseTreeView::filterChanged);
|
||||
filterChanged(_filters->currentIndex());
|
||||
|
||||
QStackedWidget *stackedWidget = new QStackedWidget;
|
||||
QStackedWidget *stackedWidget = new QStackedWidget(this);
|
||||
stackedWidget->addWidget(_treeView);
|
||||
stackedWidget->addWidget(_tableView);
|
||||
|
||||
|
||||
+17
-16
@@ -1,19 +1,20 @@
|
||||
#include "databaseview.h"
|
||||
#include <QVBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include <QSettings>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QHeaderView>
|
||||
#include <QSqlError>
|
||||
#include <QDebug>
|
||||
#include <QMenu>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QRegularExpression>
|
||||
#include <QGuiApplication>
|
||||
#include <QClipboard>
|
||||
#include <QMimeData>
|
||||
#include <iostream>
|
||||
#include "batchprocessing.h"
|
||||
#include "databaseview.h"
|
||||
#include <QClipboard>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QDebug>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QGuiApplication>
|
||||
#include <QHeaderView>
|
||||
#include <QMenu>
|
||||
#include <QMimeData>
|
||||
#include <QPushButton>
|
||||
#include <QRegularExpression>
|
||||
#include <QSettings>
|
||||
#include <QSqlError>
|
||||
#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
#include <iostream>
|
||||
|
||||
const QStringList DEFAULT_COLUMNS = {"EXPTIME", "OBJECT", "RA", "DEC"};
|
||||
|
||||
@@ -248,7 +249,7 @@ void FITSFileModel::prepareQuery()
|
||||
{
|
||||
setHeaderData(i++, Qt::Horizontal, column);
|
||||
}
|
||||
std::cout << sql.toStdString() << std::endl;
|
||||
qDebug() << "DB SQL" << sql;
|
||||
if(lastError().type() != QSqlError::NoError)
|
||||
qDebug() << "Database error" << lastError();
|
||||
|
||||
|
||||
+20
-2
@@ -1,15 +1,28 @@
|
||||
#include "mainwindow.h"
|
||||
#include <QApplication>
|
||||
#include <QSurfaceFormat>
|
||||
#include <QTranslator>
|
||||
#include <QCommandLineParser>
|
||||
#include <QSettings>
|
||||
#include <QSurfaceFormat>
|
||||
#include <QTranslator>
|
||||
#include <stdlib.h>
|
||||
#include "../thumbnailer/genthumbnail.h"
|
||||
#ifdef Q_OS_WIN64
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
bool DEBUG_LOG = false;
|
||||
|
||||
QtMessageHandler defaultHandler = nullptr;
|
||||
|
||||
void messageHandler(QtMsgType type, const QMessageLogContext &ctx, const QString &message)
|
||||
{
|
||||
if(defaultHandler)
|
||||
{
|
||||
if(DEBUG_LOG || type != QtMsgType::QtDebugMsg)
|
||||
defaultHandler(type, ctx, message);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#ifdef __linux__
|
||||
@@ -29,6 +42,7 @@ int main(int argc, char *argv[])
|
||||
freopen("CONOUT$", "w", stderr);
|
||||
}
|
||||
#endif
|
||||
defaultHandler = qInstallMessageHandler(messageHandler);
|
||||
|
||||
QCommandLineParser cmd;
|
||||
cmd.addOption({"gl", "Use desktop OpenGL. This is default on x86 and MacOS platform."});
|
||||
@@ -40,6 +54,7 @@ int main(int argc, char *argv[])
|
||||
cmd.addOption({"scriptarg", "String that will be passed to script as variable \"scriparg\"", "arg"});
|
||||
cmd.addOption({"outdir", "Output dir for script (default: CWD)", "dir", "."});
|
||||
cmd.addOption({"noexit", "Do not exit application when script finish"});
|
||||
cmd.addOption({"debug", "Print debug info"});
|
||||
cmd.addHelpOption();
|
||||
QStringList cmdArgs;
|
||||
for(int i = 0; i < argc; i++)
|
||||
@@ -51,6 +66,9 @@ int main(int argc, char *argv[])
|
||||
if(cmd.isSet("gles"))
|
||||
useGLES = true;
|
||||
|
||||
if(cmd.isSet("debug"))
|
||||
DEBUG_LOG = true;
|
||||
|
||||
if(cmd.isSet("thumb"))
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
|
||||
Reference in New Issue
Block a user