private void SaveLogsToFile() { string path = Path.Combine( Application.persistentDataPath, System.DateTime.Now.ToString( "dd-MM-yyyy--HH-mm-ss" ) + ".txt" ); File.WriteAllText( path, instance.GetAllLogs() ); Debug.Log( "Logs saved to: " + path ); }
public static void SaveLogsToFile() { string path = string.Concat(Application.dataPath.Remove(Application.dataPath.Length - 6) , "Log_" , System.DateTime.Now.ToString("dd-MM-yyyy_hh-mm-ss") , ".txt" ); try { File.WriteAllText(path, DebugLogManager.GetAllLogs()); Debug.Log("Logs saved to: " + path); } catch (System.Exception e) { Debug.LogError("Error saving logs\n" + e.ToString()); } }