/// <summary> /// Attempts to return the patch of the log file Unity is writing to. /// </summary> /// <returns></returns> public static string TryGetLogFilePath() { string logfile; if (GenCommandLine.TryGetCommandLineArg("logfile", out logfile) && logfile.NullOrEmpty()) { return(logfile); } var platform = PlatformUtility.GetCurrentPlatform(); switch (platform) { case PlatformType.Linux: return(@"/tmp/rimworld_log"); case PlatformType.MacOSX: return(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Library/Logs/Unity/Player.log")); case PlatformType.Windows: logfile = Path.Combine(UnityData.dataPath, "output_log.txt"); if (File.Exists(logfile)) { return(logfile); } return(Environment.ExpandEnvironmentVariables("%LOCALAPPDATA%") + String.Format(@"Low\{0}\{1}\output_log.txt", Application.companyName, Application.productName)); default: return(null); } }
/// <summary> /// Attempts to return the patch of the log file Unity is writing to. /// </summary> /// <returns></returns> public static string TryGetLogFilePath() { string logfile; if (GenCommandLine.TryGetCommandLineArg("logfile", out logfile) && logfile.NullOrEmpty()) { return(logfile); } var platform = PlatformUtility.GetCurrentPlatform(); switch (platform) { case PlatformType.Linux: return(@"/tmp/rimworld_log"); case PlatformType.MacOSX: return(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "Library/Logs/Unity/Player.log")); case PlatformType.Windows: return(Path.Combine(Application.persistentDataPath, "Player.log")); default: return(null); } }
/// <summary> /// Attempts to return the path of the log file Unity is writing to. /// </summary> /// <returns></returns> public static string TryGetLogFilePath() { if (TryGetCommandLineOptionValue("logfile") is var cmdLog && cmdLog != null) { return(cmdLog); } var platform = PlatformUtility.GetCurrentPlatform(); switch (platform) { case PlatformType.Linux: return(@"/tmp/rimworld_log"); case PlatformType.MacOSX: return(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), $"Library/Logs/{Application.companyName}/{Application.productName}/Player.log")); case PlatformType.Windows: return(Path.Combine(Application.persistentDataPath, "Player.log")); default: return(null); } }