mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Logger, DatFile] Minor fixes to ordering and logging
This commit is contained in:
@@ -498,14 +498,14 @@ namespace SabreTools.Library.Dats
|
||||
dirNodump = 0;
|
||||
}
|
||||
|
||||
Globals.Logger.Verbose("Beginning stat collection for '" + filename.Item1 + "'", false);
|
||||
Globals.Logger.Verbose("Beginning stat collection for '{0}'", false, filename.Item1);
|
||||
List<string> games = new List<string>();
|
||||
DatFile datdata = new DatFile();
|
||||
datdata.Parse(filename.Item1, 0, 0);
|
||||
datdata.BucketBy(SortedBy.Game, false /* mergeroms */, norename: true);
|
||||
|
||||
// Output single DAT stats (if asked)
|
||||
Globals.Logger.User("Adding stats for file '" + filename.Item1 + "'\n", false);
|
||||
Globals.Logger.User("Adding stats for file '{0}'\n", false, filename.Item1);
|
||||
if (single)
|
||||
{
|
||||
datdata.OutputStats(outputs, statDatFormat,
|
||||
|
||||
@@ -239,17 +239,6 @@ namespace SabreTools.Library
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write the given string as a verbose message to the log output
|
||||
/// </summary>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <param name="appendPrefix">True if the level and datetime should be prepended to each statement (default), false otherwise</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>s
|
||||
public bool Verbose(string output, bool appendPrefix = true)
|
||||
{
|
||||
return Log(output, LogLevel.VERBOSE, appendPrefix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write the given string as a verbose message to the log output
|
||||
/// </summary>
|
||||
@@ -262,14 +251,15 @@ namespace SabreTools.Library
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write the given string as a user message to the log output
|
||||
/// Write the given string as a verbose message to the log output
|
||||
/// </summary>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <param name="appendPrefix">True if the level and datetime should be prepended to each statement (default), false otherwise</param>
|
||||
/// <param name="args">Optional arguments for string formatting</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
public bool User(string output, bool appendPrefix = true)
|
||||
public bool Verbose(string output, bool appendPrefix = true, params object[] args)
|
||||
{
|
||||
return Log(output, LogLevel.USER, appendPrefix);
|
||||
return Log(output, LogLevel.VERBOSE, appendPrefix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -284,15 +274,15 @@ namespace SabreTools.Library
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Write the given string as a warning to the log output
|
||||
/// Write the given string as a user message to the log output
|
||||
/// </summary>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <param name="appendPrefix">True if the level and datetime should be prepended to each statement (default), false otherwise</param>
|
||||
/// <param name="args">Optional arguments for string formatting</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
public bool Warning(string output, bool appendPrefix = true)
|
||||
public bool User(string output, bool appendPrefix = true, params object[] args)
|
||||
{
|
||||
_warnings = true;
|
||||
return Log(output, LogLevel.WARNING, appendPrefix);
|
||||
return Log(output, LogLevel.USER, appendPrefix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -308,15 +298,16 @@ namespace SabreTools.Library
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the given string as an error in the log
|
||||
/// Write the given string as a warning to the log output
|
||||
/// </summary>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <param name="appendPrefix">True if the level and datetime should be prepended to each statement (default), false otherwise</param>
|
||||
/// <param name="args">Optional arguments for string formatting</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
public bool Error(string output, bool appendPrefix = true)
|
||||
public bool Warning(string output, bool appendPrefix = true, params object[] args)
|
||||
{
|
||||
_errors = true;
|
||||
return Log(output, LogLevel.ERROR, appendPrefix);
|
||||
_warnings = true;
|
||||
return Log(output, LogLevel.WARNING, appendPrefix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -331,6 +322,19 @@ namespace SabreTools.Library
|
||||
return Log(string.Format(output, args), LogLevel.ERROR, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Writes the given string as an error in the log
|
||||
/// </summary>
|
||||
/// <param name="output">String to be written log</param>
|
||||
/// <param name="appendPrefix">True if the level and datetime should be prepended to each statement (default), false otherwise</param>
|
||||
/// <param name="args">Optional arguments for string formatting</param>
|
||||
/// <returns>True if the output could be written, false otherwise</returns>
|
||||
public bool Error(string output, bool appendPrefix = true, params object[] args)
|
||||
{
|
||||
_errors = true;
|
||||
return Log(output, LogLevel.ERROR, appendPrefix);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear lines beneath the given line in the console
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user