mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 06:44:27 +00:00
commit
f84b6e9020
16
verbosity.c
16
verbosity.c
@ -50,12 +50,14 @@
|
|||||||
* will write to this file. */
|
* will write to this file. */
|
||||||
static FILE *log_file = NULL;
|
static FILE *log_file = NULL;
|
||||||
static bool main_verbosity = false;
|
static bool main_verbosity = false;
|
||||||
|
static bool initialized = false;
|
||||||
|
|
||||||
void verbosity_enable(void)
|
void verbosity_enable(void)
|
||||||
{
|
{
|
||||||
main_verbosity = true;
|
main_verbosity = true;
|
||||||
#ifdef RARCH_INTERNAL
|
#ifdef RARCH_INTERNAL
|
||||||
frontend_driver_attach_console();
|
if (!log_file)
|
||||||
|
frontend_driver_attach_console();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +65,8 @@ void verbosity_disable(void)
|
|||||||
{
|
{
|
||||||
main_verbosity = false;
|
main_verbosity = false;
|
||||||
#ifdef RARCH_INTERNAL
|
#ifdef RARCH_INTERNAL
|
||||||
frontend_driver_detach_console();
|
if (!log_file)
|
||||||
|
frontend_driver_detach_console();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,11 +87,14 @@ void *retro_main_log_file(void)
|
|||||||
|
|
||||||
void retro_main_log_file_init(const char *path)
|
void retro_main_log_file_init(const char *path)
|
||||||
{
|
{
|
||||||
|
if (initialized)
|
||||||
|
return;
|
||||||
log_file = stderr;
|
log_file = stderr;
|
||||||
if (path == NULL)
|
if (path == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
log_file = fopen(path, "wb");
|
log_file = fopen(path, "wb");
|
||||||
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void retro_main_log_file_deinit(void)
|
void retro_main_log_file_deinit(void)
|
||||||
@ -102,7 +108,7 @@ void retro_main_log_file_deinit(void)
|
|||||||
void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
|
void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
#if TARGET_OS_IPHONE
|
#if TARGET_OS_IPHONE
|
||||||
static int asl_inited = 0;
|
static int asl_initialized = 0;
|
||||||
#if !TARGET_IPHONE_SIMULATOR
|
#if !TARGET_IPHONE_SIMULATOR
|
||||||
static aslclient asl_client;
|
static aslclient asl_client;
|
||||||
#endif
|
#endif
|
||||||
@ -117,10 +123,10 @@ static aslclient asl_client;
|
|||||||
#if TARGET_IPHONE_SIMULATOR
|
#if TARGET_IPHONE_SIMULATOR
|
||||||
vprintf(fmt, ap);
|
vprintf(fmt, ap);
|
||||||
#else
|
#else
|
||||||
if (!asl_inited)
|
if (!asl_initialized)
|
||||||
{
|
{
|
||||||
asl_client = asl_open(file_path_str(FILE_PATH_PROGRAM_NAME), "com.apple.console", ASL_OPT_STDERR | ASL_OPT_NO_DELAY);
|
asl_client = asl_open(file_path_str(FILE_PATH_PROGRAM_NAME), "com.apple.console", ASL_OPT_STDERR | ASL_OPT_NO_DELAY);
|
||||||
asl_inited = 1;
|
asl_initialized = 1;
|
||||||
}
|
}
|
||||||
aslmsg msg = asl_new(ASL_TYPE_MSG);
|
aslmsg msg = asl_new(ASL_TYPE_MSG);
|
||||||
asl_set(msg, ASL_KEY_READ_UID, "-1");
|
asl_set(msg, ASL_KEY_READ_UID, "-1");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user