mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-25 08:59:58 +00:00
(RARCH_CONSOLE) Move logger function invocations into platform
files
This commit is contained in:
parent
bc4e010a96
commit
92ef192b2a
@ -150,12 +150,8 @@ begin_shutdown:
|
||||
menu_free();
|
||||
uninit_drivers_console();
|
||||
|
||||
#ifdef HAVE_LOGGER
|
||||
logger_shutdown();
|
||||
#elif defined(HAVE_FILE_LOGGER)
|
||||
if (g_extern.log_file)
|
||||
fclose(g_extern.log_file);
|
||||
g_extern.log_file = NULL;
|
||||
#ifdef PERF_TEST
|
||||
rarch_perf_log();
|
||||
#endif
|
||||
|
||||
system_deinit();
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include "../../general.h"
|
||||
#include "../../libretro.h"
|
||||
|
||||
#include "platform_inl.h"
|
||||
|
||||
#include "../../console/rgui/rgui.h"
|
||||
#include "../../gfx/fonts/bitmap.h"
|
||||
|
||||
@ -467,14 +469,12 @@ static void system_init(void)
|
||||
fatInitDefault();
|
||||
|
||||
#ifdef HAVE_LOGGER
|
||||
g_extern.verbose = true;
|
||||
logger_init();
|
||||
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)
|
||||
g_extern.verbose = true;
|
||||
g_extern.log_file = fopen("/retroarch-log.txt", "w");
|
||||
inl_logger_init();
|
||||
devoptab_list[STD_OUT] = &dotab_stdout;
|
||||
devoptab_list[STD_ERR] = &dotab_stdout;
|
||||
dotab_stdout.write_r = gx_logger_file;
|
||||
@ -533,6 +533,9 @@ static void system_deinit_save(void)
|
||||
|
||||
static void system_deinit(void)
|
||||
{
|
||||
#if defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
|
||||
inl_logger_deinit()
|
||||
#endif
|
||||
}
|
||||
|
||||
static void system_exitspawn(void)
|
||||
|
41
frontend/platform/platform_inl.h
Normal file
41
frontend/platform/platform_inl.h
Normal file
@ -0,0 +1,41 @@
|
||||
/* RetroArch - A frontend for libretro.
|
||||
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
|
||||
* Copyright (C) 2011-2013 - Daniel De Matteis
|
||||
*
|
||||
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
||||
* of the GNU General Public License as published by the Free Software Found-
|
||||
* ation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
#endif
|
@ -16,6 +16,8 @@
|
||||
|
||||
#include <sys/process.h>
|
||||
|
||||
#include "platform_inl.h"
|
||||
|
||||
#include "../../ps3/sdk_defines.h"
|
||||
#include "../../ps3/ps3_input.h"
|
||||
|
||||
@ -243,8 +245,8 @@ static void system_init(void)
|
||||
sys_net_initialize_network();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOGGER
|
||||
logger_init();
|
||||
#if defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
|
||||
inl_logger_init();
|
||||
#endif
|
||||
|
||||
#ifndef __PSL1GHT__
|
||||
@ -309,8 +311,8 @@ static void system_deinit(void)
|
||||
oskutil_unload(osk);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOGGER
|
||||
logger_shutdown();
|
||||
#if defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
|
||||
inl_logger_deinit();
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYSMODULES)
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
|
||||
#include "platform_inl.h"
|
||||
|
||||
#if defined(_XBOX360)
|
||||
#include <xfilecache.h>
|
||||
#include "../../360/frontend-xdk/menu.h"
|
||||
@ -128,6 +130,10 @@ static void system_post_init(void)
|
||||
|
||||
static void system_init(void)
|
||||
{
|
||||
#if defined (HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
|
||||
inl_logger_init();
|
||||
#endif
|
||||
|
||||
#ifdef _XBOX1
|
||||
// Mount drives
|
||||
xbox_io_mount("A:", "cdrom0");
|
||||
@ -147,6 +153,9 @@ static void system_process_args(int argc, char *argv[])
|
||||
|
||||
static void system_deinit(void)
|
||||
{
|
||||
#if defined (HAVE_LOGGER) || defined(HAVE_FILE_LOGGER)
|
||||
logger_deinit();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void system_deinit_save(void)
|
||||
|
Loading…
Reference in New Issue
Block a user