From b7ca3d7e3703651026706eef09cd998c8efab438 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 17 May 2020 11:25:27 +1000 Subject: [PATCH] [client] cleanup debug output --- VERSION | 2 +- client/src/main.c | 12 +++++++++--- common/include/common/debug.h | 1 + 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index 8d242dc5..8b4f5f3c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-188-gdcce288a98+1 \ No newline at end of file +B1-189-gc4bf992c0c+1 \ No newline at end of file diff --git a/client/src/main.c b/client/src/main.c index c1ae6e9f..7b32cf83 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1200,9 +1200,9 @@ static int lg_run() // warn about using FPS display until we can fix the font rendering to prevent lag spikes if (params.showFPS) { - DEBUG_WARN("================================================================================"); + DEBUG_BREAK(); DEBUG_WARN("WARNING: The FPS display causes microstutters, this is a known issue" ); - DEBUG_WARN("================================================================================"); + DEBUG_BREAK(); } if (SDL_Init(SDL_INIT_VIDEO) < 0) @@ -1443,6 +1443,10 @@ static int lg_run() SDL_SetHintWithPriority(SDL_HINT_MOUSE_RELATIVE_MODE_WARP, "1", SDL_HINT_OVERRIDE); SDL_SetEventFilter(eventFilter, NULL); + // wait for startup to complete so that any error messages below are output at + // the end of the output + lgWaitEvent(e_startup, TIMEOUT_INFINITE); + LGMP_STATUS status; while(true) { @@ -1463,9 +1467,11 @@ static int lg_run() memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) != 0 || udata->version != KVMFR_VERSION) { + DEBUG_BREAK(); DEBUG_ERROR("The host application is not compatible with this client"); - DEBUG_ERROR("Expected KVMFR version %d\n", KVMFR_VERSION); + DEBUG_ERROR("Expected KVMFR version %d", KVMFR_VERSION); DEBUG_ERROR("This is not a Looking Glass error, do not report this"); + DEBUG_BREAK(); return -1; } diff --git a/common/include/common/debug.h b/common/include/common/debug.h index bd231afc..df044c4a 100644 --- a/common/include/common/debug.h +++ b/common/include/common/debug.h @@ -55,6 +55,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA #define DEBUG_PRINT(type, fmt, ...) do {fprintf(stderr, "%" PRId64 " " type " %20s:%-4u | %-30s | " fmt "\n", microtime(), STRIPPATH(__FILE__), __LINE__, __FUNCTION__, ##__VA_ARGS__);} while (0) +#define DEBUG_BREAK() DEBUG_PRINT("[ ]", "%s", "================================================================================") #define DEBUG_INFO(fmt, ...) DEBUG_PRINT("[I]", fmt, ##__VA_ARGS__) #define DEBUG_WARN(fmt, ...) DEBUG_PRINT("[W]", fmt, ##__VA_ARGS__) #define DEBUG_ERROR(fmt, ...) DEBUG_PRINT("[E]", fmt, ##__VA_ARGS__)