diff --git a/src/audio/playqueue.c b/src/audio/playqueue.c index 305074fc..02eae894 100644 --- a/src/audio/playqueue.c +++ b/src/audio/playqueue.c @@ -276,7 +276,6 @@ PlayQueue_s *playq_createPlayQueue(const unsigned int *nodeIdPtr, unsigned long #define SELF_TEST 0 #if SELF_TEST -bool do_logging = true; static void _test_creation(void) { LOG("begin test"); diff --git a/src/meta/log.c b/src/meta/log.c index 60692365..2b7c4977 100644 --- a/src/meta/log.c +++ b/src/meta/log.c @@ -11,6 +11,8 @@ #include "common.h" +#define DO_STDERR_LOGGING 0 + // log.c : // - simple and not-particularly-performant logging functions // - do not call in a tight loop! @@ -21,9 +23,6 @@ #define LOG_PATH_TEMPLATE "%s%sapple2ix_log.%u.txt" -bool do_logging = true; -bool do_std_logging = true; - static int logFd = -1; static off_t logSiz = 0; static const unsigned int logRotateSize = 1024 * 1024; @@ -100,17 +99,15 @@ void log_outputString(const char * const str) { return; } - if (UNLIKELY(!do_logging)) { - return; - } - - if (do_std_logging) { +#if DO_STDERR_LOGGING + { #if defined(__ANDROID__) && !defined(NDEBUG) __android_log_print(ANDROID_LOG_ERROR, "apple2ix", "%s", str); #else fprintf(stderr, "%s\n", str); #endif } +#endif if (UNLIKELY(logFd < 0)) { return; diff --git a/src/meta/log.h b/src/meta/log.h index f0148d62..0cd24640 100644 --- a/src/meta/log.h +++ b/src/meta/log.h @@ -23,12 +23,6 @@ extern GLenum safeGLGetError(void); # define safeGLGetError() 0 #endif -// global logging kill switch -extern bool do_logging; - -// log to the standard log facility (e.g., stderr) -extern bool do_std_logging; - // initialize logging facility void log_init(void); @@ -98,22 +92,22 @@ void log_outputString(const char * const str); #endif #define LOG(...) \ - if (LIKELY(do_logging)) { \ + do { \ GLenum _glerr = safeGLGetError(); \ _LOG(__VA_ARGS__); \ while ( (_glerr = safeGLGetError()) ) { \ _LOG(__VA_ARGS__); \ } \ - } // + } while(0) // // GL_MAYBELOG() only logs if an OpenGL error occurred # define GL_MAYBELOG(...) \ - if (LIKELY(do_logging)) { \ + do { \ GLenum _glerr = 0; \ while ( (_glerr = safeGLGetError()) ) { \ _LOG(__VA_ARGS__); \ } \ - } // + } while(0) // #define QUIT_FUNCTION(x) exit(x) diff --git a/src/test/testcommon.c b/src/test/testcommon.c index 5a9543b7..5401ae5c 100644 --- a/src/test/testcommon.c +++ b/src/test/testcommon.c @@ -35,12 +35,6 @@ void test_breakpoint(void *arg) { } void test_common_init(void) { -#if __ANDROID__ - // tags help us wade through log soup -#else - do_std_logging = false;// silence regular emulator logging -#endif - extern void emulator_ctors(void); emulator_ctors(); diff --git a/src/video/ncvideo.c b/src/video/ncvideo.c index 2f3d6f88..130f114e 100644 --- a/src/video/ncvideo.c +++ b/src/video/ncvideo.c @@ -495,8 +495,7 @@ static void ncvideo_main_loop(void) { initscr(); _nc_initColors(); - LOG("ncurses video main loop beginning, silencing STDERR logging ..."); - do_std_logging = false; + LOG("ncurses video main loop beginning ..."); noecho(); // Do not echo output ... raw(); // Line buffering disabled ...