Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Merge branch 'Mallis' into gurrenm3
Browse files Browse the repository at this point in the history
  • Loading branch information
Gurrenm3 authored and Gurrenm3 committed May 12, 2020
2 parents b62d337 + a69101a commit 5ab4cbc
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions BTDToolbox/Console.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,27 @@ public void CreateLogFile()
}
public void WriteToLogFile(string text)
{
string logFile = Environment.CurrentDirectory + "\\ConsoleLog.txt";
string logText = File.ReadAllText(logFile);
try
{
string logFile = Environment.CurrentDirectory + "\\ConsoleLog.txt";
string logText = File.ReadAllText(logFile);

if(logText.Length > 0)
logText += "\n";
logText += text;
if (logText.Length > 0)
logText += "\n";
logText += text;

try
try
{
StreamWriter stream = new StreamWriter(logFile);
stream.Write(logText);
stream.Close();
}
catch { };
}catch(IOException)
{
StreamWriter stream = new StreamWriter(logFile);
stream.Write(logText);
stream.Close();
ConsoleHandler.append("couldn't save the console log");
}
catch { };

}

private void Sizer_MouseUp(object sender, MouseEventArgs e)
Expand Down

0 comments on commit 5ab4cbc

Please sign in to comment.