From 715222365f26f69ac2d1c16583a5e212dcff7f2c Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 12 Nov 2017 03:00:54 +0100 Subject: [PATCH] Logging: Windows build --- logging/logging.pro | 35 +++++++++++++++++++++++++++++++++++ logging/logmessage.cpp | 2 +- sdrgui/sdrgui.pro | 5 +++++ windows.install.bat | 3 ++- windows64.install.bat | 1 + 5 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 logging/logging.pro diff --git a/logging/logging.pro b/logging/logging.pro new file mode 100644 index 000000000..92b2b9d90 --- /dev/null +++ b/logging/logging.pro @@ -0,0 +1,35 @@ +#-------------------------------------------------------- +# +# Pro file for Android and Windows builds with Qt Creator +# +#-------------------------------------------------------- + +QT += core + +TEMPLATE = lib +TARGET = logging + +INCLUDEPATH += $$PWD +QMAKE_CXXFLAGS += -std=c++11 + +CONFIG(Release):build_subdir = release +CONFIG(Debug):build_subdir = debug + +# Enable very detailed debug messages when compiling the debug version +CONFIG(debug, debug|release) { + DEFINES += SUPERVERBOSE +} + +HEADERS += $$PWD/logglobal.h \ + $$PWD/logmessage.h \ + $$PWD/logger.h \ + $$PWD/filelogger.h \ + $$PWD/dualfilelogger.h \ + $$PWD/loggerwithfile.h + +SOURCES += $$PWD/logmessage.cpp \ + $$PWD/logger.cpp \ + $$PWD/filelogger.cpp \ + $$PWD/dualfilelogger.cpp \ + $$PWD/loggerwithfile.cpp + diff --git a/logging/logmessage.cpp b/logging/logmessage.cpp index a4bac897e..fcb0c2b0a 100644 --- a/logging/logmessage.cpp +++ b/logging/logmessage.cpp @@ -68,7 +68,7 @@ QString LogMessage::toString(const QString& msgFormat, const QString& timestampF decorated.replace("{line}",QString::number(line)); QString threadId; - threadId.setNum((unsigned long)QThread::currentThreadId()); + threadId.setNum((std::size_t)QThread::currentThreadId()); decorated.replace("{thread}",threadId); // Fill in variables diff --git a/sdrgui/sdrgui.pro b/sdrgui/sdrgui.pro index b2f52709f..2f0c2d25a 100644 --- a/sdrgui/sdrgui.pro +++ b/sdrgui/sdrgui.pro @@ -11,6 +11,7 @@ TEMPLATE = lib TARGET = sdrgui INCLUDEPATH += $$PWD INCLUDEPATH += ../sdrbase +INCLUDEPATH += ../logging DEFINES += USE_KISSFFT=1 win32 { @@ -61,6 +62,7 @@ SOURCES += mainwindow.cpp\ gui/glspectrumgui.cpp\ gui/indicator.cpp\ gui/levelmeter.cpp\ + gui/loggingdialog.cpp\ gui/pluginsdialog.cpp\ gui/audiodialog.cpp\ gui/presetitem.cpp\ @@ -106,6 +108,7 @@ HEADERS += mainwindow.h\ gui/glspectrumgui.h\ gui/indicator.h\ gui/levelmeter.h\ + gui/loggingdialog.h\ gui/physicalunit.h\ gui/pluginsdialog.h\ gui/presetitem.h\ @@ -135,11 +138,13 @@ FORMS += mainwindow.ui\ gui/samplingdevicecontrol.ui\ gui/samplingdevicedialog.ui\ gui/myposdialog.ui\ + gui/loggingdialog.ui\ gui/glspectrumgui.ui\ gui/transverterdialog.ui\ mainwindow.ui LIBS += -L../sdrbase/$${build_subdir} -lsdrbase +LIBS += -L../logging/$${build_subdir} -llogging RESOURCES = resources/res.qrc diff --git a/windows.install.bat b/windows.install.bat index 0f2c70ad3..3fcec9e9b 100644 --- a/windows.install.bat +++ b/windows.install.bat @@ -7,11 +7,12 @@ SET libzlib1dir="D:\softs\zlib-1.2.5" copy app\%1\sdrangel.exe %2 copy sdrbase\%1\sdrbase.dll %2 copy sdrgui\%1\sdrgui.dll %2 - copy devices\%1\devices.dll %2 +copy devices\%1\devices.dll %2 copy mbelib\%1\mbelib.dll %2 copy dsdcc\%1\dsdcc.dll %2 copy serialdv\%1\serialdv.dll %2 copy httpserver\%1\httpserver.dll %2 +copy logging\%1\logging.dll %2 copy libhackrf\%1\libhackrf.dll %2 copy librtlsdr\%1\librtlsdr.dll %2 copy libairspy\%1\libairspy.dll %2 diff --git a/windows64.install.bat b/windows64.install.bat index 3b29a6e37..ce3be9800 100644 --- a/windows64.install.bat +++ b/windows64.install.bat @@ -32,6 +32,7 @@ copy dsdcc\%1\dsdcc.dll %2 copy serialdv\%1\serialdv.dll %2 copy nanomsg\%1\nanomsg.dll %2 copy httpserver\%1\httpserver.dll %2 +copy logging\%1\logging.dll %2 copy libhackrf\%1\libhackrf.dll %2 copy librtlsdr\%1\librtlsdr.dll %2 copy libairspy\%1\libairspy.dll %2