mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Change logging behavior
This commit is contained in:
@@ -97,21 +97,21 @@ 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
|
||||||
try
|
if (_tofile)
|
||||||
{
|
{
|
||||||
_log.WriteLine(output);
|
try
|
||||||
}
|
{
|
||||||
catch
|
_log.WriteLine(output);
|
||||||
{
|
}
|
||||||
Console.WriteLine("Could not write to log file!");
|
catch
|
||||||
return false;
|
{
|
||||||
|
Console.WriteLine("Could not write to log file!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user