Skip to content

Commit 72ff910

Browse files
committed
Automatic merge of T1.5.1-1852-g24537f48e and 10 pull requests
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting - Pull request #1062 at 9a76b26: Train Forces popup Window. - Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1) - Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1090 at 9e0bfe8: Add null check to avoid crash on corrupt signal files - Pull request #1092 at d5816e4: Adds $gradient, $req, depart-early and passing-time to Manual - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification - Pull request #1091 at b0c622b: Automatic speed control
12 parents 5552c7a + 24537f4 + 362e4e7 + 9a76b26 + 1be1fc4 + 37e2817 + e10390b + 9e0bfe8 + d5816e4 + 5845a1a + 689494b + b0c622b commit 72ff910

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

Source/RunActivity/Viewer3D/Processes/GameStateRunActivity.cs

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class GameStateRunActivity : GameState
5252

5353
static Viewer Viewer { get { return Program.Viewer; } set { Program.Viewer = value; } }
5454
static ORTraceListener ORTraceListener { get { return Program.ORTraceListener; } set { Program.ORTraceListener = value; } }
55-
static string logFilePath { get { return Program.logFileName; } set { Program.logFileName = value; } }
55+
static string logFileName { get { return Program.logFileName; } set { Program.logFileName = value; } }
5656
static string EvaluationFilename { get { return Program.EvaluationFilename; } set { Program.EvaluationFilename = value; } }
5757

5858
/// <summary>
@@ -811,30 +811,13 @@ void InitLogging(UserSettings settings, string[] args, bool appendLog)
811811
{
812812
fileName = settings.LoggingFilename;
813813
}
814-
logFilePath = GetFilePath(settings, fileName);
814+
logFileName = GetFilePath(settings, fileName);
815815

816816
// Ensure we start with an empty file.
817817
if (!appendLog)
818-
{
819-
if (File.Exists(logFilePath))
820-
{
821-
try
822-
{
823-
var logFileExtension = Path.GetExtension(logFilePath);
824-
var prevLogPath = Path.ChangeExtension(logFilePath, ".prev" + logFileExtension);
825-
if (File.Exists(prevLogPath)) { File.Delete(prevLogPath); }
826-
File.Move(logFilePath, prevLogPath);
827-
}
828-
catch (Exception e)
829-
{
830-
Console.WriteLine("Failed to move log file: " + e.Message);
831-
File.Delete(logFilePath);
832-
}
833-
}
834-
}
835-
818+
File.Delete(logFileName);
836819
// Make Console.Out go to the log file AND the output stream.
837-
Console.SetOut(new FileTeeLogger(logFilePath, Console.Out));
820+
Console.SetOut(new FileTeeLogger(logFileName, Console.Out));
838821
// Make Console.Error go to the new Console.Out.
839822
Console.SetError(Console.Out);
840823
}
@@ -853,8 +836,8 @@ void InitLogging(UserSettings settings, string[] args, bool appendLog)
853836
LogSeparator();
854837
Console.WriteLine("Version = {0}", VersionInfo.Version.Length > 0 ? VersionInfo.Version : "<none>");
855838
Console.WriteLine("Build = {0}", VersionInfo.Build);
856-
if (logFilePath.Length > 0)
857-
Console.WriteLine("Logfile = {0}", logFilePath);
839+
if (logFileName.Length > 0)
840+
Console.WriteLine("Logfile = {0}", logFileName);
858841
Console.WriteLine("Executable = {0}", Path.GetFileName(ApplicationInfo.ProcessFile));
859842
foreach (var arg in args)
860843
Console.WriteLine("Argument = {0}", arg);
@@ -1062,8 +1045,8 @@ void UninitLoading()
10621045

10631046
static void CopyLog(string toFile)
10641047
{
1065-
if (logFilePath.Length == 0) return;
1066-
File.Copy(logFilePath, toFile, true);
1048+
if (logFileName.Length == 0) return;
1049+
File.Copy(logFileName, toFile, true);
10671050
}
10681051

10691052
void InitSimulator(UserSettings settings, string[] args, string mode)

0 commit comments

Comments
 (0)