diff --git a/SabreTools.Library/Dats/Partials/DatFile.Statistics.cs b/SabreTools.Library/Dats/Partials/DatFile.Statistics.cs index e8a3d683..c312a1ca 100644 --- a/SabreTools.Library/Dats/Partials/DatFile.Statistics.cs +++ b/SabreTools.Library/Dats/Partials/DatFile.Statistics.cs @@ -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 games = new List(); 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, diff --git a/SabreTools.Library/Logger.cs b/SabreTools.Library/Logger.cs index 3e6f53cb..71f0e318 100644 --- a/SabreTools.Library/Logger.cs +++ b/SabreTools.Library/Logger.cs @@ -239,17 +239,6 @@ namespace SabreTools.Library return true; } - /// - /// Write the given string as a verbose message to the log output - /// - /// String to be written log - /// True if the level and datetime should be prepended to each statement (default), false otherwise - /// True if the output could be written, false otherwises - public bool Verbose(string output, bool appendPrefix = true) - { - return Log(output, LogLevel.VERBOSE, appendPrefix); - } - /// /// Write the given string as a verbose message to the log output /// @@ -262,14 +251,15 @@ namespace SabreTools.Library } /// - /// Write the given string as a user message to the log output + /// Write the given string as a verbose message to the log output /// /// String to be written log /// True if the level and datetime should be prepended to each statement (default), false otherwise + /// Optional arguments for string formatting /// True if the output could be written, false otherwise - 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); } /// @@ -284,15 +274,15 @@ namespace SabreTools.Library } /// - /// Write the given string as a warning to the log output + /// Write the given string as a user message to the log output /// /// String to be written log /// True if the level and datetime should be prepended to each statement (default), false otherwise + /// Optional arguments for string formatting /// True if the output could be written, false otherwise - 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); } /// @@ -308,15 +298,16 @@ namespace SabreTools.Library } /// - /// Writes the given string as an error in the log + /// Write the given string as a warning to the log output /// /// String to be written log /// True if the level and datetime should be prepended to each statement (default), false otherwise + /// Optional arguments for string formatting /// True if the output could be written, false otherwise - 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); } /// @@ -331,6 +322,19 @@ namespace SabreTools.Library return Log(string.Format(output, args), LogLevel.ERROR, true); } + /// + /// Writes the given string as an error in the log + /// + /// String to be written log + /// True if the level and datetime should be prepended to each statement (default), false otherwise + /// Optional arguments for string formatting + /// True if the output could be written, false otherwise + public bool Error(string output, bool appendPrefix = true, params object[] args) + { + _errors = true; + return Log(output, LogLevel.ERROR, appendPrefix); + } + /// /// Clear lines beneath the given line in the console ///