Change logging behavior

This commit is contained in:
Matt Nadareski
2016-03-30 12:18:56 -07:00
parent 7f6c8c5ab4
commit 4720e412c3

View File

@@ -97,13 +97,12 @@ namespace SabreTools.Helper
/// <returns>True if the output could be written, false otherwise</returns> /// <returns>True if the output could be written, false otherwise</returns>
public bool Log(string output) public bool Log(string output)
{ {
// If we're writing to console, just write the string // Everything writes to console
if (!_tofile)
{
Console.WriteLine(output); Console.WriteLine(output);
return true;
}
// If we're writing to file, use the existing stream // If we're writing to file, use the existing stream
if (_tofile)
{
try try
{ {
_log.WriteLine(output); _log.WriteLine(output);
@@ -113,6 +112,7 @@ namespace SabreTools.Helper
Console.WriteLine("Could not write to log file!"); Console.WriteLine("Could not write to log file!");
return false; return false;
} }
}
return true; return true;
} }