mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Logger, Stats] Add suppression of end runtime
This commit is contained in:
@@ -85,10 +85,12 @@ namespace SabreTools.Helper
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// End logging by closing output file (if necessary)
|
/// End logging by closing output file (if necessary)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="suppress">True if all ending output is to be suppressed, false otherwise (default)</param>
|
||||||
/// <returns>True if the logging was ended correctly, false otherwise</returns>
|
/// <returns>True if the logging was ended correctly, false otherwise</returns>
|
||||||
public bool Close()
|
public bool Close(bool suppress = false)
|
||||||
|
{
|
||||||
|
if (!suppress)
|
||||||
{
|
{
|
||||||
|
|
||||||
TimeSpan span = DateTime.Now.Subtract(_start);
|
TimeSpan span = DateTime.Now.Subtract(_start);
|
||||||
string total = span.ToString(@"hh\:mm\:ss\.fffff");
|
string total = span.ToString(@"hh\:mm\:ss\.fffff");
|
||||||
if (!_tofile)
|
if (!_tofile)
|
||||||
@@ -108,6 +110,18 @@ namespace SabreTools.Helper
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_log.Close();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -553,7 +553,7 @@ namespace SabreTools
|
|||||||
statlog.Start();
|
statlog.Start();
|
||||||
Stats stats = new Stats(newinputs, single, statlog);
|
Stats stats = new Stats(newinputs, single, statlog);
|
||||||
stats.Process();
|
stats.Process();
|
||||||
statlog.Close();
|
statlog.Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user