Refactor: Move FileManager to common, add macOS file management support

This commit is contained in:
yuanyuanxiang
2026-05-03 09:57:46 +02:00
parent a3611d9fc1
commit 36423b1c7c
11 changed files with 206 additions and 35 deletions

View File

@@ -321,6 +321,16 @@ inline const char* getFileName(const char* path)
#endif
#elif defined(_WIN32)
#define Mprintf(format, ...) Logger::getInstance().log(getFileName((__FILE__)), __LINE__, (format), __VA_ARGS__)
#elif defined(__APPLE__)
// macOS: 使用 NSLog 输出到系统日志(可通过 Console.app 查看)
#ifdef Mprintf
#undef Mprintf
#endif
#ifdef __OBJC__
#define Mprintf(format, ...) NSLog(@"%@", [NSString stringWithFormat:@(format), ##__VA_ARGS__])
#else
#define Mprintf(format, ...) printf(format, ##__VA_ARGS__)
#endif
#else
// Linux: 覆盖 commands.h 中的 printf 回退定义,改用 Logger 写文件
#ifdef Mprintf