Skip to content

Commit

Permalink
Implement log file creation
Browse files Browse the repository at this point in the history
  • Loading branch information
DartPower committed Jun 2, 2019
1 parent c6e349a commit c7db666
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ static void start(string clientdir, string client, string user, string uuid, str
Info.UseShellExecute = false;
Info.RedirectStandardOutput = true;
Info.RedirectStandardError = true;
Info.StandardOutputEncoding = Encoding.GetEncoding("CP866");
Process process = new Process();
StreamWriter streamWriter = File.CreateText(@"SharpMCL.log");
process.StartInfo = Info;
Action<object, DataReceivedEventArgs> actionWrite = (sender, e) =>
{
Console.WriteLine(e.Data);
streamWriter.WriteLine(e.Data);
};
process.ErrorDataReceived += (sender, e) => actionWrite(sender, e);
process.OutputDataReceived += (sender, e) => actionWrite(sender, e);
Expand Down

0 comments on commit c7db666

Please sign in to comment.