2023-03-07 12:50:17 -05:00
|
|
|
#pragma once
|
|
|
|
|
2024-02-20 21:41:37 -05:00
|
|
|
/**
|
|
|
|
** \defgroup log Logging helpers
|
|
|
|
** @{
|
|
|
|
*/
|
|
|
|
|
2023-03-07 12:50:17 -05:00
|
|
|
#if defined(__ANDROID__)
|
|
|
|
#include <android/log.h>
|
|
|
|
#define tf_printf(...) __android_log_print(ANDROID_LOG_INFO, "tildefriends", __VA_ARGS__)
|
2023-10-15 12:55:25 -04:00
|
|
|
#elif defined(__APPLE__)
|
2023-10-20 22:12:27 -04:00
|
|
|
#include <TargetConditionals.h>
|
|
|
|
#if TARGET_OS_IPHONE
|
2023-10-15 12:55:25 -04:00
|
|
|
#include <os/log.h>
|
2024-02-15 18:35:01 -05:00
|
|
|
#define tf_printf(...) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
char buffer##__LINE__[2048]; \
|
|
|
|
snprintf(buffer##__LINE__, sizeof(buffer##__LINE__), __VA_ARGS__); \
|
|
|
|
os_log(OS_LOG_DEFAULT, "%{public}s", buffer##__LINE__); \
|
|
|
|
} while (0)
|
2023-03-07 12:50:17 -05:00
|
|
|
#else
|
|
|
|
#include <stdio.h>
|
|
|
|
#define tf_printf printf
|
|
|
|
#endif
|
2023-10-20 22:12:27 -04:00
|
|
|
#else
|
|
|
|
#include <stdio.h>
|
|
|
|
#define tf_printf printf
|
|
|
|
#endif
|
2024-02-20 21:41:37 -05:00
|
|
|
|
|
|
|
/** @} */
|