Add 'NSLog' to Apple platform log in game
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include <mach-o/dyld.h>
|
||||
#include <uuid/uuid.h>
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <CoreGraphics/CoreGraphics.h>
|
||||
#include <SystemConfiguration/SystemConfiguration.h>
|
||||
#include <IOKit/IOKitLib.h>
|
||||
@@ -195,6 +196,13 @@ void ApplePlatform::GetUTCTime(int32& year, int32& month, int32& dayOfWeek, int3
|
||||
millisecond = time.tv_usec / 1000;
|
||||
}
|
||||
|
||||
void ApplePlatform::Log(const StringView& msg)
|
||||
{
|
||||
#if !BUILD_RELEASE && !USE_EDITOR
|
||||
NSLog(@"%s", StringAsANSI<>(*msg, msg.Length()).Get());
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ApplePlatform::Init()
|
||||
{
|
||||
if (UnixPlatform::Init())
|
||||
|
||||
@@ -79,6 +79,7 @@ public:
|
||||
static uint64 GetClockFrequency();
|
||||
static void GetSystemTime(int32& year, int32& month, int32& dayOfWeek, int32& day, int32& hour, int32& minute, int32& second, int32& millisecond);
|
||||
static void GetUTCTime(int32& year, int32& month, int32& dayOfWeek, int32& day, int32& hour, int32& minute, int32& second, int32& millisecond);
|
||||
static void Log(const StringView& msg);
|
||||
static bool Init();
|
||||
static void Tick();
|
||||
static void BeforeExit();
|
||||
|
||||
Reference in New Issue
Block a user