2022-01-16 01:04:43 +01:00
|
|
|
#include "logger.h"
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <whb/log_cafe.h>
|
|
|
|
#include <whb/log_module.h>
|
2022-02-02 19:57:14 +01:00
|
|
|
#include <whb/log_udp.h>
|
2022-01-16 01:04:43 +01:00
|
|
|
|
|
|
|
uint32_t moduleLogInit = false;
|
2022-02-03 14:01:11 +01:00
|
|
|
uint32_t cafeLogInit = false;
|
|
|
|
uint32_t udpLogInit = false;
|
2022-01-16 01:04:43 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void initLogging() {
|
|
|
|
#ifdef DEBUG
|
|
|
|
if (!(moduleLogInit = WHBLogModuleInit())) {
|
|
|
|
cafeLogInit = WHBLogCafeInit();
|
2022-02-03 14:01:11 +01:00
|
|
|
udpLogInit = WHBLogUdpInit();
|
2022-01-16 01:04:43 +01:00
|
|
|
}
|
2022-02-03 13:03:38 +01:00
|
|
|
#endif // DEBUG
|
2022-01-16 01:04:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void deinitLogging() {
|
|
|
|
#ifdef DEBUG
|
|
|
|
if (moduleLogInit) {
|
|
|
|
WHBLogModuleDeinit();
|
|
|
|
moduleLogInit = false;
|
|
|
|
}
|
|
|
|
if (cafeLogInit) {
|
|
|
|
WHBLogCafeDeinit();
|
|
|
|
cafeLogInit = false;
|
|
|
|
}
|
|
|
|
if (udpLogInit) {
|
|
|
|
WHBLogUdpDeinit();
|
|
|
|
udpLogInit = false;
|
|
|
|
}
|
2022-02-03 13:03:38 +01:00
|
|
|
#endif // DEBUG
|
2022-01-16 01:04:43 +01:00
|
|
|
}
|