Skip to content

Commit

Permalink
#27 Improved handling of log files for Shuffle Runner.
Browse files Browse the repository at this point in the history
Now the log file is placed by default at the target directory
  • Loading branch information
imranakram committed Mar 7, 2021
1 parent 7d038b6 commit 1f2f93d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions XTB/Runner/ShuffleRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ShuffleRunner()
ConnectionUpdated += ShuffleRunner_ConnectionUpdated;
}

void ShuffleRunner_ConnectionUpdated(object sender, ConnectionUpdatedEventArgs e)
private void ShuffleRunner_ConnectionUpdated(object sender, ConnectionUpdatedEventArgs e)
{
EnableShuffle();
}
Expand Down Expand Up @@ -77,9 +77,11 @@ private void btnShuffle_Click(object sender, EventArgs e)
{
shuffeling = true;
EnableShuffle();
var logpath = Path.Combine(Paths.LogsPath, "ShuffleRunner");
var container = new CintContainer(Service, logpath);

var definitionpath = Path.GetDirectoryName(txtFile.Text);
var logPath = Path.Combine(definitionpath, DateTime.Now.ToString("yyyyMMdd") + "_" + DateTime.Now.ToString("HHmmss") + "_" + "ShuffleRunner" + "_" + ConnectionDetail + ".log");
var container = new CintContainer(Service, logPath);

var location = System.Reflection.Assembly.GetExecutingAssembly().Location;
var verinfo = FileVersionInfo.GetVersionInfo(location);
container.Log(" *** {0} ***", verinfo.Comments.PadRight(50));
Expand All @@ -88,7 +90,7 @@ private void btnShuffle_Click(object sender, EventArgs e)
var definition = new XmlDocument();
definition.Load(txtFile.Text);
ReplaceShufflePlaceholders(definition);
var definitionpath = Path.GetDirectoryName(txtFile.Text);

try
{
if (rbExport.Checked)
Expand Down Expand Up @@ -329,4 +331,4 @@ public void OnIncomingMessage(MessageBusEventArgs message)

public event EventHandler<MessageBusEventArgs> OnOutgoingMessage;
}
}
}

0 comments on commit 1f2f93d

Please sign in to comment.