Move more code to verbosity.c

This commit is contained in:
twinaphex 2015-11-29 03:08:27 +01:00
parent e0e9f1a716
commit dc44fd479c
2 changed files with 32 additions and 32 deletions

View File

@ -13,8 +13,30 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#if defined(HAVE_FILE_LOGGER)
#define LOG_FILE (retro_main_log_file())
#else
#define LOG_FILE (stderr)
#endif
#if defined(IS_SALAMANDER)
#define PROGRAM_NAME "RetroArch Salamander"
#elif defined(RARCH_INTERNAL)
#define PROGRAM_NAME "RetroArch"
#elif defined(MARCH_INTERNAL)
#define PROGRAM_NAME "MicroArch"
#else
#define PROGRAM_NAME "N/A"
#endif
#include "verbosity.h"
#if TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
static aslclient asl_client;
static int asl_inited = 0;
#endif
static bool main_verbosity;
/* If this is non-NULL. RARCH_LOG and friends
@ -48,6 +70,15 @@ void retro_main_log_file_deinit(void)
}
#if !defined(HAVE_LOGGER)
static bool RARCH_LOG_VERBOSE(void)
{
bool *verbose = NULL;
verbose = retro_main_verbosity();
if (!verbose)
return false;
return *verbose;
}
void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
{
if (!RARCH_LOG_VERBOSE())
@ -145,3 +176,4 @@ void RARCH_ERR(const char *fmt, ...)
va_end(ap);
}
#endif

View File

@ -52,38 +52,6 @@ void retro_main_log_file_deinit(void);
void retro_main_log_file_init(const char *path);
#if defined(HAVE_FILE_LOGGER)
#define LOG_FILE (retro_main_log_file())
#else
#define LOG_FILE (stderr)
#endif
#if defined(IS_SALAMANDER)
#define PROGRAM_NAME "RetroArch Salamander"
#elif defined(RARCH_INTERNAL)
#define PROGRAM_NAME "RetroArch"
#elif defined(MARCH_INTERNAL)
#define PROGRAM_NAME "MicroArch"
#else
#define PROGRAM_NAME "N/A"
#endif
static INLINE bool RARCH_LOG_VERBOSE(void)
{
bool *verbose = NULL;
verbose = retro_main_verbosity();
if (!verbose)
return false;
return *verbose;
}
#if TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
static aslclient asl_client;
static int asl_inited = 0;
#endif
#if defined(HAVE_LOGGER)
#define BUFSIZE (64 * 1024)