From b7ce5e6c02d6760e49437546323bbdef9ee55836 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 30 Apr 2013 02:50:09 +0200 Subject: [PATCH] Re-added logging samples to overcome capital L directory --- samples/logging/CMakeLists.txt | 6 ++++++ samples/logging/main.cpp | 20 ++++++++++++++++++++ samples/logging/sample_logging.pro | 23 +++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 samples/logging/CMakeLists.txt create mode 100644 samples/logging/main.cpp create mode 100644 samples/logging/sample_logging.pro diff --git a/samples/logging/CMakeLists.txt b/samples/logging/CMakeLists.txt new file mode 100644 index 000000000..ca4e75148 --- /dev/null +++ b/samples/logging/CMakeLists.txt @@ -0,0 +1,6 @@ +FILE(GLOB SRC *.cpp) + +ADD_EXECUTABLE(sample_logging ${SRC}) + +TARGET_LINK_LIBRARIES(sample_logging blackmisc ${QT_LIBRARIES}) +SET_TARGET_PROPERTIES(sample_logging PROPERTIES PROJECT_LABEL "Samples - Logging") \ No newline at end of file diff --git a/samples/logging/main.cpp b/samples/logging/main.cpp new file mode 100644 index 000000000..1ad1a607a --- /dev/null +++ b/samples/logging/main.cpp @@ -0,0 +1,20 @@ +#include +#include "blackmisc/debug.h" +#include "blackmisc/context.h" +#include +#include + +int main(int argc, char *argv[]) +{ + QCoreApplication a(argc, argv); + BlackMisc::CApplicationContext myApplicationContext; + + BlackMisc::IContext::getInstance().setSingleton(new BlackMisc::CDebug()); + + bAppInfo << "This is a Info log message"; + bAppWarning << "This is a bWarning log message"; + bAppError << "This is a bError log message"; + bAppDebug << "This is a bDebug log message"; + + return a.exec(); +} diff --git a/samples/logging/sample_logging.pro b/samples/logging/sample_logging.pro new file mode 100644 index 000000000..b262a6322 --- /dev/null +++ b/samples/logging/sample_logging.pro @@ -0,0 +1,23 @@ +QT += core +QT -= gui + +TARGET = sample_logging +TEMPLATE = app + +CONFIG += console +CONFIG -= app_bundle + +DEPENDPATH += . ../../src +INCLUDEPATH += . ../../src + +SOURCES += *.cpp + +LIBS += -L../../lib -lblackmisc + +win32:!win32-g++*: PRE_TARGETDEPS += ../../lib/blackmisc.lib +else: PRE_TARGETDEPS += ../../lib/libblackmisc.a + +DESTDIR = ../../bin + + +