geode/loader/src/platform/mac/crashlog.mm

28 lines
634 B
Text
Raw Normal View History

2022-11-28 14:08:21 -05:00
#include <crashlog.hpp>
2022-10-08 10:27:28 -04:00
#ifdef GEODE_IS_MACOS
2023-02-08 08:42:34 -05:00
#include <array>
#include <ghc/fs_fwd.hpp>
2022-10-30 14:56:36 -04:00
2023-02-08 09:43:31 -05:00
#import <Foundation/Foundation.h>
2022-10-08 11:20:32 -04:00
2022-10-08 10:27:28 -04:00
bool crashlog::setupPlatformHandler() {
return true;
}
bool crashlog::didLastLaunchCrash() {
return false;
}
ghc::filesystem::path crashlog::getCrashLogDirectory() {
2022-10-08 10:27:28 -04:00
std::array<char, 1024> path;
2022-10-30 14:56:36 -04:00
CFStringGetCString(
(CFStringRef)NSHomeDirectory(), path.data(), path.size(), kCFStringEncodingUTF8
);
auto crashlogDir =
ghc::filesystem::path(path.data()) / "Library" / "Logs" / "DiagnosticReports";
2022-10-08 10:27:28 -04:00
return crashlogDir.string();
}
#endif