Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
add_compile_definitions(LCM_LOG_DEFAULT_ENABLED=1)

if(BUILD_CONNMAN)
add_executable(connmanctl_dbus connmanctl.cpp)
target_link_libraries(connmanctl_dbus PRIVATE GConnmanDbus)
Expand Down
1 change: 1 addition & 0 deletions examples/connmanctl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ auto main() -> int {
std::mutex cin_mutex;
std::condition_variable cin_cv;
bool connecting = false;
Amarula::Log::enable(true);
Connman connman;
const auto manager = connman.manager();
manager->onRequestInputPassphrase([&](const auto& service) -> auto {
Expand Down
4 changes: 0 additions & 4 deletions include/amarula/log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ class Log {

private:
static auto state() -> std::atomic<bool>& {
#ifdef LCM_LOG_DEFAULT_ENABLED
static std::atomic<bool> flag{true};
#else
static std::atomic<bool> flag{false};
#endif
return flag;
}
};
Expand Down
5 changes: 2 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
add_compile_definitions(LCM_LOG_DEFAULT_ENABLED=1)
Comment thread
EddyTheCo marked this conversation as resolved.

include(FetchContent)
FetchContent_Declare(
googletest
Expand All @@ -22,7 +20,8 @@ install(
if(BUILD_CONNMAN)
foreach(connman_test gconnman_clock_test gconnman_tech_test
gconnman_serv_test)
add_executable(${connman_test} ${connman_test}.cpp qt_thread_bundle.hpp)
add_executable(${connman_test} ${connman_test}.cpp qt_thread_bundle.hpp
logging_init.cpp)
target_link_libraries(${connman_test} PRIVATE GConnmanDbus gtest_main)

target_include_directories(${connman_test}
Expand Down
9 changes: 9 additions & 0 deletions tests/logging_init.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <amarula/log.hpp>

namespace {
struct EnableLogging {
EnableLogging() { Amarula::Log::enable(true); }
};

[[maybe_unused]] EnableLogging enable_logging;
} // namespace
Loading