Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public async override void ViewDidLoad ()
break;
}
if (options.EnableXml) {
runner.WriteResultsToFile (writer, jargon);
runner.WriteResultsToFile (writer ?? Console.Out, jargon);
logger.Info ("Xml file was written to the tcp listener.");
} else {
string resultsFilePath = runner.WriteResultsToFile (jargon);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ public async override void ViewDidLoad ()
base.ViewDidLoad ();
var options = ApplicationOptions.Current;
TcpTextWriter writer = null;
if (!string.IsNullOrEmpty (options.HostName))
writer = new TcpTextWriter (options.HostName, options.HostPort);
if (!string.IsNullOrEmpty (options.HostName)) {
try {
writer = new TcpTextWriter (options.HostName, options.HostPort);
} catch (Exception ex) {
Console.WriteLine ("Network error: Cannot connect to {0}:{1}: {2}. Continuing on console.", options.HostName, options.HostPort, ex);
writer = null; // will default to the console
}
}

// we generate the logs in two different ways depending if the generate xml flag was
// provided. If it was, we will write the xml file to the tcp writer if present, else
Expand Down Expand Up @@ -97,7 +103,7 @@ public async override void ViewDidLoad ()
break;
}
if (options.EnableXml) {
runner.WriteResultsToFile (writer, jargon);
runner.WriteResultsToFile (writer ?? Console.Out, jargon);
logger.Info ("Xml file was written to the tcp listener.");
} else {
string resultsFilePath = runner.WriteResultsToFile (jargon);
Expand Down