mirror of
https://github.com/wiiu-env/AutobootModule.git
synced 2024-11-22 10:59:15 +01:00
Only do logging when building with make DEBUG=1
This commit is contained in:
parent
fb5cf55dd6
commit
b985de6b7a
5
Makefile
5
Makefile
@ -38,6 +38,11 @@ LDFLAGS = -g $(ARCH) $(RPXSPECS) --entry=_start -Wl,-Map,$(notdir $*.map)
|
||||
|
||||
LIBS := -lfreetype -lpng -lbz2 -lwut -lz
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
CXXFLAGS += -DDEBUG -g
|
||||
CCFLAGS += -DDEBUG -g
|
||||
endif
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# list of directories containing libraries, this must be the top level
|
||||
# containing include and lib
|
||||
|
@ -1,23 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <whb/log.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
#include <whb/log.h>
|
||||
#ifdef DEBUG
|
||||
|
||||
#define __FILENAME_X__ (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__)
|
||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILENAME_X__)
|
||||
|
||||
#define DEBUG_FUNCTION_LINE(FMT, ARGS...)do { \
|
||||
WHBLogPrintf("[%23s]%30s@L%04d: " FMT "",__FILENAME__,__FUNCTION__, __LINE__, ## ARGS); \
|
||||
} while (0);
|
||||
} while (0)
|
||||
|
||||
#define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...)do { \
|
||||
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
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -353,10 +353,12 @@ int32_t handleMenuScreen(int32_t autobootOptionInput) {
|
||||
|
||||
|
||||
int32_t main(int32_t argc, char **argv) {
|
||||
#ifdef DEBUG
|
||||
if (!WHBLogModuleInit()) {
|
||||
WHBLogCafeInit();
|
||||
WHBLogUdpInit();
|
||||
}
|
||||
#endif // DEBUG
|
||||
DEBUG_FUNCTION_LINE("Hello from Autoboot");
|
||||
|
||||
initExternalStorage();
|
||||
|
Loading…
Reference in New Issue
Block a user