mirror of
https://github.com/wiiu-env/EnvironmentLoader.git
synced 2025-02-10 10:18:55 +01:00
Only do logging when building with make DEBUG=1
This commit is contained in:
parent
86f124baaa
commit
6cbe000c49
5
Makefile
5
Makefile
@ -38,6 +38,11 @@ CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__
|
|||||||
|
|
||||||
CXXFLAGS := $(CFLAGS) -std=c++20
|
CXXFLAGS := $(CFLAGS) -std=c++20
|
||||||
|
|
||||||
|
ifeq ($(DEBUG),1)
|
||||||
|
CXXFLAGS += -DDEBUG -g
|
||||||
|
CCFLAGS += -DDEBUG -g
|
||||||
|
endif
|
||||||
|
|
||||||
ASFLAGS := -g $(ARCH)
|
ASFLAGS := -g $(ARCH)
|
||||||
LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map)
|
LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map)
|
||||||
|
|
||||||
|
@ -55,10 +55,12 @@ extern "C" uint32_t textStart();
|
|||||||
std::string EnvironmentSelectionScreen(const std::map<std::string, std::string> &payloads);
|
std::string EnvironmentSelectionScreen(const std::map<std::string, std::string> &payloads);
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
#ifdef DEBUG
|
||||||
if (!WHBLogModuleInit()) {
|
if (!WHBLogModuleInit()) {
|
||||||
WHBLogCafeInit();
|
WHBLogCafeInit();
|
||||||
WHBLogUdpInit();
|
WHBLogUdpInit();
|
||||||
}
|
}
|
||||||
|
#endif // DEBUG
|
||||||
|
|
||||||
DEBUG_FUNCTION_LINE("Hello from EnvironmentLoader!");
|
DEBUG_FUNCTION_LINE("Hello from EnvironmentLoader!");
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
|
||||||
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
|
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
|
||||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)
|
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)
|
||||||
|
|
||||||
@ -18,6 +20,14 @@ extern "C" {
|
|||||||
WHBLogWritef("[%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \
|
WHBLogWritef("[%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define DEBUG_FUNCTION_LINE(FMT, ARGS...) while (0)
|
||||||
|
|
||||||
|
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) while (0)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user