EnvironmentLoader/source/utils/logger.c

36 lines
718 B
C
Raw Normal View History

2022-01-30 13:56:33 +01:00
#ifdef DEBUG
#include <stdint.h>
#include <whb/log_cafe.h>
#include <whb/log_module.h>
#include <whb/log_udp.h>
2022-01-30 13:56:33 +01:00
uint32_t moduleLogInit = false;
uint32_t cafeLogInit = false;
uint32_t udpLogInit = false;
#endif// DEBUG
2022-01-30 13:56:33 +01:00
void initLogging() {
#ifdef DEBUG
if (!(moduleLogInit = WHBLogModuleInit())) {
cafeLogInit = WHBLogCafeInit();
udpLogInit = WHBLogUdpInit();
}
#endif// DEBUG
2022-01-30 13:56:33 +01:00
}
void deinitLogging() {
#ifdef DEBUG
if (moduleLogInit) {
WHBLogModuleDeinit();
moduleLogInit = false;
}
if (cafeLogInit) {
WHBLogCafeDeinit();
cafeLogInit = false;
}
if (udpLogInit) {
WHBLogUdpDeinit();
udpLogInit = false;
}
#endif// DEBUG
2022-01-30 13:56:33 +01:00
}