From 79160a0747be79865815057c6f5c797ec2b88453 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 6 Nov 2021 23:31:22 +0100 Subject: [PATCH] Update the example plugin to prefer the LoggingModule --- plugins/example_plugin/src/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/example_plugin/src/main.cpp b/plugins/example_plugin/src/main.cpp index 6f0d6c3..1281964 100644 --- a/plugins/example_plugin/src/main.cpp +++ b/plugins/example_plugin/src/main.cpp @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include #include @@ -34,7 +36,10 @@ bool logFSOpen = true; Get's called ONCE when the loader exits, but BEFORE the ON_APPLICATION_START gets called or functions are overridden. **/ INITIALIZE_PLUGIN(){ - WHBLogUdpInit(); + if (!WHBLogModuleInit()) { + WHBLogCafeInit(); + WHBLogUdpInit(); + } DEBUG_FUNCTION_LINE("INITIALIZE_PLUGIN of example_plugin!"); // Open storage to read values @@ -64,7 +69,10 @@ DEINITIALIZE_PLUGIN(){ Make sure to initialize all functions you're using in the overridden functions! **/ ON_APPLICATION_START(){ - WHBLogUdpInit(); + if (!WHBLogModuleInit()) { + WHBLogCafeInit(); + WHBLogUdpInit(); + } DEBUG_FUNCTION_LINE("ON_APPLICATION_START of example_plugin!"); }