mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-08 06:06:43 +01:00
android: log into logcat
This commit is contained in:
parent
bbba7da52f
commit
f922ffe997
2 changed files with 11 additions and 1 deletions
|
@ -26,4 +26,8 @@ SET_TARGET_PROPERTIES("libsuperderpy" PROPERTIES PREFIX "")
|
|||
|
||||
target_link_libraries("libsuperderpy" ${ALLEGRO5_LIBRARIES} ${ALLEGRO5_FONT_LIBRARIES} ${ALLEGRO5_TTF_LIBRARIES} ${ALLEGRO5_PRIMITIVES_LIBRARIES} ${ALLEGRO5_AUDIO_LIBRARIES} ${ALLEGRO5_ACODEC_LIBRARIES} ${ALLEGRO5_VIDEO_LIBRARIES} ${ALLEGRO5_IMAGE_LIBRARIES} m dl)
|
||||
|
||||
if (ANDROID)
|
||||
target_link_libraries("libsuperderpy" log)
|
||||
endif (ANDROID)
|
||||
|
||||
install(TARGETS "libsuperderpy" DESTINATION ${LIB_INSTALL_DIR})
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef ALLEGRO_ANDROID
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
// TODO: split to separate files
|
||||
|
||||
|
@ -397,7 +400,7 @@ __attribute__((__format__(__printf__, 5, 0))) SYMBOL_EXPORT void PrintConsoleWit
|
|||
ALLEGRO_DEBUG("%s\n", text);
|
||||
SUPPRESS_END
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
#if !defined(__EMSCRIPTEN__) && !defined(ALLEGRO_ANDROID)
|
||||
if (game->config.debug)
|
||||
#endif
|
||||
{
|
||||
|
@ -405,6 +408,9 @@ __attribute__((__format__(__printf__, 5, 0))) SYMBOL_EXPORT void PrintConsoleWit
|
|||
printf("%s:%d ", file, line);
|
||||
}
|
||||
printf("[%s] %s\n", func, text);
|
||||
#ifdef ALLEGRO_ANDROID
|
||||
__android_log_print(ANDROID_LOG_DEBUG, al_get_app_name(), "[%s] %s", func, text);
|
||||
#endif
|
||||
fflush(stdout);
|
||||
}
|
||||
game->_priv.console_pos++;
|
||||
|
|
Loading…
Reference in a new issue