Skip to content

Commit

Permalink
improved log with emscripten_log uilities
Browse files Browse the repository at this point in the history
  • Loading branch information
kalwalt committed Dec 22, 2023
1 parent fd5ac00 commit 201d6c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/SRC/ARUtil/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
# define snprintf _snprintf
#endif

#ifdef __EMSCRIPTEN__
#include <emscripten/console.h>
#endif

//
// Global required for logging functions.
//
Expand Down Expand Up @@ -204,9 +208,9 @@ void arLogv(const char *tag, const int logLevel, const char *format, va_list ap)

#ifdef __EMSCRIPTEN__
if(logLevel == AR_LOG_LEVEL_ERROR)
fprintf(stderr, "%s", buf);
emscripten_console_error(buf);
else
fprintf(stdout, "%s", buf);
emscripten_console_warn(buf);
#else
fprintf(stderr, "%s", buf);
#endif
Expand Down

0 comments on commit 201d6c3

Please sign in to comment.