Skip to content

Commit 2d5cef6

Browse files
committed
Added logging function.
1 parent 4a6f2a1 commit 2d5cef6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1360
-8
lines changed

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ ENDIF ()
120120
SET (Boost_USE_MULTITHREADED ON)
121121
FIND_PACKAGE (Threads REQUIRED)
122122

123-
FIND_PACKAGE (Boost 1.67.0 REQUIRED COMPONENTS system date_time)
123+
FIND_PACKAGE (Boost 1.67.0 REQUIRED COMPONENTS system date_time log)
124124

125125
IF (MQTT_USE_TLS)
126126
FIND_PACKAGE (OpenSSL REQUIRED)

Diff for: example/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ LIST (APPEND exec_PROGRAMS
77
v5_no_tls_server.cpp
88
v5_no_tls_both.cpp
99
v5_no_tls_prop.cpp
10+
logging.cpp
1011
redirect.cpp
1112
broker.cpp
1213
)
@@ -43,7 +44,8 @@ ENDIF ()
4344
FOREACH (source_file ${exec_PROGRAMS})
4445
GET_FILENAME_COMPONENT (source_file_we ${source_file} NAME_WE)
4546
ADD_EXECUTABLE (${source_file_we} ${source_file})
46-
TARGET_LINK_LIBRARIES (${source_file_we} mqtt_cpp_iface)
47+
TARGET_COMPILE_DEFINITIONS (${source_file_we} PUBLIC $<IF:$<BOOL:${MQTT_USE_STATIC_BOOST}>,,BOOST_LOG_DYN_LINK>)
48+
TARGET_LINK_LIBRARIES (${source_file_we} mqtt_cpp_iface Boost::log)
4749
ENDFOREACH ()
4850

4951
IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")

Diff for: example/broker.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#include "../test/test_server_no_tls.hpp"
22
#include "../test/test_broker.hpp"
3+
#include <mqtt/setup_log.hpp>
34

45
int main() {
6+
MQTT_NS::setup_log();
57
boost::asio::io_context ioc;
68
test_broker b(ioc);
79
test_server_no_tls s(ioc, b);

0 commit comments

Comments
 (0)