From 97cec15dcd866e20c933889c7196b1487e393c8c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 25 Nov 2013 15:12:59 +0100 Subject: [PATCH] (iOS) Will now log to XCode organizer device console --- apple/logger_override.h | 51 +++++++++++++++++++++++++++++++++++++++++ retroarch_logger.h | 3 ++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 apple/logger_override.h diff --git a/apple/logger_override.h b/apple/logger_override.h new file mode 100644 index 0000000000..9c2c19988e --- /dev/null +++ b/apple/logger_override.h @@ -0,0 +1,51 @@ +/* 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 . + */ + +#ifndef __APPLE_IOS_LOGGER_H +#define __APPLE_IOS_LOGGER_H + +#include +#include + +static void INTERNAL_LOG(const char *fmt, ...) +{ + aslmsg msg = asl_new(ASL_TYPE_MSG); + asl_set(msg, ASL_KEY_READ_UID, "-1"); + asl_log(NULL, msg, ASL_LEVEL_NOTICE, fmt); + asl_free(msg); +} + +static inline void RARCH_LOG(const char *fmt, ...) +{ + INTERNAL_LOG(fmt); +} + +static inline void RARCH_LOG_OUTPUT(const char *msg, ...) +{ + INTERNAL_LOG(msg); +} + +static inline void RARCH_WARN(const char *msg, ...) +{ + INTERNAL_LOG(msg); +} + +static inline void RARCH_ERR(const char *msg, ...) +{ + INTERNAL_LOG(msg); +} + +#endif diff --git a/retroarch_logger.h b/retroarch_logger.h index 0bc7b74ba1..b66a321cbf 100644 --- a/retroarch_logger.h +++ b/retroarch_logger.h @@ -33,8 +33,9 @@ #if defined(RARCH_CONSOLE) && (defined(HAVE_LOGGER) || defined(_XBOX1)) #include +#elif defined(IOS) +#include "apple/logger_override.h" #else - #if defined(RARCH_DUMMY_LOG) || !defined(RARCH_INTERNAL) #define RARCH_LOG_VERBOSE (true) #else