Move logger_init/logger_deinit to frontend_console.c and out

of platform implementations
This commit is contained in:
twinaphex 2013-04-23 03:17:45 +02:00
parent fda5db7476
commit a647535df0
5 changed files with 18 additions and 61 deletions

View File

@ -24,28 +24,6 @@
char input_path[1024];
static inline void inl_logger_init(void)
{
#if defined(HAVE_LOGGER)
g_extern.verbose = true;
logger_init();
#elif defined(HAVE_FILE_LOGGER)
g_extern.verbose = true;
g_extern.log_file = fopen("/retroarch-log.txt", "w");
#endif
}
static inline void inl_logger_deinit(void)
{
#if defined(HAVE_LOGGER)
logger_shutdown();
#elif defined(HAVE_FILE_LOGGER)
if (g_extern.log_file)
fclose(g_extern.log_file);
g_extern.log_file = NULL;
#endif
}
#if defined(__CELLOS_LV2__)
#include "platform/platform_ps3_exec.c"
#include "platform/platform_ps3.c"
@ -110,6 +88,13 @@ static bool libretro_install_core(const char *path_prefix, const char *extension
int rarch_main(int argc, char *argv[])
{
system_init();
#if defined(HAVE_LOGGER)
g_extern.verbose = true;
logger_init();
#elif defined(HAVE_FILE_LOGGER)
g_extern.verbose = true;
g_extern.log_file = fopen("/retroarch-log.txt", "w");
#endif
rarch_main_clear_state();
@ -237,6 +222,14 @@ int rarch_main(int argc, char *argv[])
rarch_perf_log();
#endif
#if defined(HAVE_LOGGER)
logger_shutdown();
#elif defined(HAVE_FILE_LOGGER)
if (g_extern.log_file)
fclose(g_extern.log_file);
g_extern.log_file = NULL;
#endif
system_deinit();
if (g_extern.lifecycle_mode_state & (1ULL << MODE_EXITSPAWN))

View File

@ -299,18 +299,14 @@ static void system_init(void)
fatInitDefault();
#ifdef HAVE_LOGGER
inl_logger_init();
devoptab_list[STD_OUT] = &dotab_stdout;
devoptab_list[STD_ERR] = &dotab_stdout;
dotab_stdout.write_r = gx_logger_net;
#elif defined(HAVE_FILE_LOGGER)
inl_logger_init();
#ifndef IS_SALAMANDER
#elif defined(HAVE_FILE_LOGGER) && !defined(IS_SALAMANDER)
devoptab_list[STD_OUT] = &dotab_stdout;
devoptab_list[STD_ERR] = &dotab_stdout;
dotab_stdout.write_r = gx_logger_file;
#endif
#endif
#if defined(HW_RVL) && !defined(IS_SALAMANDER)
lwp_t gx_device_thread;
@ -336,12 +332,7 @@ static void system_exitspawn(void)
#endif
}
static void system_deinit(void)
{
#if defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
inl_logger_deinit();
#endif
}
static void system_deinit(void) {}
#ifndef IS_SALAMANDER
static void system_process_args(int argc, char *argv[])

View File

@ -320,13 +320,6 @@ static void system_init(void)
#ifndef __PSL1GHT__
sys_net_initialize_network();
#endif
#if defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
inl_logger_init();
#endif
#ifndef __PSL1GHT__
sceNpInit(NP_POOL_SIZE, np_pool);
#endif
@ -368,12 +361,7 @@ static void system_deinit(void)
{
#ifndef IS_SALAMANDER
#if defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
inl_logger_deinit();
#endif
#if defined(HAVE_SYSMODULES)
#ifdef HAVE_FREETYPE
/* Freetype font PRX */
cellSysmoduleLoadModule(CELL_SYSMODULE_FONTFT);

View File

@ -105,12 +105,6 @@ static void system_process_args(int argc, char *argv[])
static void system_deinit(void)
{
#ifdef HAVE_FILE_LOGGER
if (g_extern.log_file)
fclose(g_extern.log_file);
g_extern.log_file = NULL;
#endif
sceKernelExitGame();
}

View File

@ -258,10 +258,6 @@ static void get_environment_settings(int argc, char *argv[])
static void system_init(void)
{
#if defined (HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
inl_logger_init();
#endif
#if defined(_XBOX1) && !defined(IS_SALAMANDER)
// Mount drives
xbox_io_mount("A:", "cdrom0");
@ -279,12 +275,7 @@ static void system_process_args(int argc, char *argv[])
(void)argv;
}
static void system_deinit(void)
{
#if defined (HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
logger_deinit();
#endif
}
static void system_deinit(void) {}
static void system_exitspawn(void)
{