mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ALL] Use params variant for logging
This commit is contained in:
@@ -71,7 +71,7 @@ namespace SabreTools.Library.Tools
|
||||
// 7-zip
|
||||
if (at == ArchiveType.SevenZip && (archiveScanLevel & ArchiveScanLevel.SevenZipInternal) != 0)
|
||||
{
|
||||
Globals.Logger.Verbose("Found archive of type: " + at);
|
||||
Globals.Logger.Verbose("Found archive of type: {0}", at);
|
||||
|
||||
// Create the temp directory
|
||||
Directory.CreateDirectory(outDir);
|
||||
@@ -89,7 +89,7 @@ namespace SabreTools.Library.Tools
|
||||
// GZip
|
||||
else if (at == ArchiveType.GZip && (archiveScanLevel & ArchiveScanLevel.GZipInternal) != 0)
|
||||
{
|
||||
Globals.Logger.Verbose("Found archive of type: " + at);
|
||||
Globals.Logger.Verbose("Found archive of type: {0}", at);
|
||||
|
||||
// Create the temp directory
|
||||
Directory.CreateDirectory(outDir);
|
||||
@@ -109,7 +109,7 @@ namespace SabreTools.Library.Tools
|
||||
// RAR
|
||||
else if (at == ArchiveType.Rar && (archiveScanLevel & ArchiveScanLevel.RarInternal) != 0)
|
||||
{
|
||||
Globals.Logger.Verbose("Found archive of type: " + at);
|
||||
Globals.Logger.Verbose("Found archive of type: {0}", at);
|
||||
|
||||
// Create the temp directory
|
||||
Directory.CreateDirectory(outDir);
|
||||
@@ -127,7 +127,7 @@ namespace SabreTools.Library.Tools
|
||||
// TAR
|
||||
else if (at == ArchiveType.Tar && (archiveScanLevel & ArchiveScanLevel.TarInternal) != 0)
|
||||
{
|
||||
Globals.Logger.Verbose("Found archive of type: " + at);
|
||||
Globals.Logger.Verbose("Found archive of type: {0}", at);
|
||||
|
||||
// Create the temp directory
|
||||
Directory.CreateDirectory(outDir);
|
||||
@@ -145,7 +145,7 @@ namespace SabreTools.Library.Tools
|
||||
// Zip
|
||||
else if (at == ArchiveType.Zip && (archiveScanLevel & ArchiveScanLevel.ZipInternal) != 0)
|
||||
{
|
||||
Globals.Logger.Verbose("Found archive of type: " + at);
|
||||
Globals.Logger.Verbose("Found archive of type: {0}", at);
|
||||
|
||||
// Create the temp directory
|
||||
Directory.CreateDirectory(outDir);
|
||||
@@ -461,7 +461,7 @@ namespace SabreTools.Library.Tools
|
||||
IReader reader = null;
|
||||
try
|
||||
{
|
||||
Globals.Logger.Verbose("Found archive of type: " + at);
|
||||
Globals.Logger.Verbose("Found archive of type: {0}", at);
|
||||
|
||||
switch (at)
|
||||
{
|
||||
@@ -614,7 +614,7 @@ namespace SabreTools.Library.Tools
|
||||
|
||||
try
|
||||
{
|
||||
Globals.Logger.Verbose("Found archive of type: " + at);
|
||||
Globals.Logger.Verbose("Found archive of type: {0}", at);
|
||||
|
||||
switch (at)
|
||||
{
|
||||
@@ -915,21 +915,21 @@ namespace SabreTools.Library.Tools
|
||||
// If we have the romba depot files, just skip them gracefully
|
||||
if (datum == ".romba_size" || datum == ".romba_size.backup")
|
||||
{
|
||||
Globals.Logger.Verbose("Romba depot file found, skipping: " + input);
|
||||
Globals.Logger.Verbose("Romba depot file found, skipping: {0}", input);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check if the name is the right length
|
||||
if (!Regex.IsMatch(datum, @"^[0-9a-f]{" + Constants.SHA1Length + @"}\.gz")) // TODO: When updating to SHA-256, this needs to update to Constants.SHA256Length
|
||||
{
|
||||
Globals.Logger.Warning("Non SHA-1 filename found, skipping: '" + Path.GetFullPath(input) + "'");
|
||||
Globals.Logger.Warning("Non SHA-1 filename found, skipping: '{0}'", Path.GetFullPath(input));
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check if the file is at least the minimum length
|
||||
if (filesize < 40 /* bytes */)
|
||||
{
|
||||
Globals.Logger.Warning("Possibly corrupt file '" + Path.GetFullPath(input) + "' with size " + Style.GetBytesReadable(filesize));
|
||||
Globals.Logger.Warning("Possibly corrupt file '{0}' with size {1}", Path.GetFullPath(input), Style.GetBytesReadable(filesize));
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1424,7 +1424,7 @@ namespace SabreTools.Library.Tools
|
||||
}
|
||||
catch
|
||||
{
|
||||
Globals.Logger.Warning("File '" + filename + "' could not be opened");
|
||||
Globals.Logger.Warning("File '{0}' could not be opened", filename);
|
||||
ist7z = 0;
|
||||
}
|
||||
}
|
||||
@@ -2253,7 +2253,7 @@ namespace SabreTools.Library.Tools
|
||||
// Check that the input file exists
|
||||
if (!File.Exists(inputFile))
|
||||
{
|
||||
Globals.Logger.Warning("File " + inputFile + " does not exist!");
|
||||
Globals.Logger.Warning("File '{0}' does not exist!", inputFile);
|
||||
return false;
|
||||
}
|
||||
inputFile = Path.GetFullPath(inputFile);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace SabreTools.Library.Tools
|
||||
"'" + header + "', " +
|
||||
"'" + source + "')";
|
||||
slc = new SqliteCommand(query, dbc);
|
||||
Globals.Logger.Verbose("Result of inserting header: " + slc.ExecuteNonQuery());
|
||||
Globals.Logger.Verbose("Result of inserting header: {0}", slc.ExecuteNonQuery());
|
||||
}
|
||||
|
||||
// Dispose of database objects
|
||||
@@ -182,7 +182,7 @@ CREATE TABLE IF NOT EXISTS data (
|
||||
{
|
||||
while (sldr.Read())
|
||||
{
|
||||
Globals.Logger.Verbose("Found match with rom type " + sldr.GetString(1));
|
||||
Globals.Logger.Verbose("Found match with rom type '{0}'", sldr.GetString(1));
|
||||
headers.Add(sldr.GetString(0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,12 +59,12 @@ namespace SabreTools.Library.Tools
|
||||
}
|
||||
|
||||
// Read the input file, if possible
|
||||
Globals.Logger.Verbose("Attempting to read file to get format: \"" + filename + "\"");
|
||||
Globals.Logger.Verbose("Attempting to read file to get format: {0}", filename);
|
||||
|
||||
// Check if file exists
|
||||
if (!File.Exists(filename))
|
||||
{
|
||||
Globals.Logger.Warning("File '" + filename + "' could not read from!");
|
||||
Globals.Logger.Warning("File '{0}' could not read from!", filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ namespace SabreTools.Library.Tools
|
||||
Directory.CreateDirectory(outDir);
|
||||
}
|
||||
|
||||
Globals.Logger.User("\nGetting skipper information for '" + file + "'");
|
||||
Globals.Logger.User("\nGetting skipper information for '{0}'", file);
|
||||
|
||||
// Get the skipper rule that matches the file, if any
|
||||
SkipperRule rule = Skipper.GetMatchingRule(file, "");
|
||||
@@ -431,7 +431,7 @@ namespace SabreTools.Library.Tools
|
||||
}
|
||||
catch (PathTooLongException)
|
||||
{
|
||||
Globals.Logger.Warning("The path for " + file + " was too long");
|
||||
Globals.Logger.Warning("The path for '{0}' was too long", file);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -447,7 +447,7 @@ namespace SabreTools.Library.Tools
|
||||
}
|
||||
catch (PathTooLongException)
|
||||
{
|
||||
Globals.Logger.Warning("The path for " + input + " was too long");
|
||||
Globals.Logger.Warning("The path for '{0}' was too long", input);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -466,12 +466,12 @@ namespace SabreTools.Library.Tools
|
||||
/// <returns>The XmlTextReader representing the (possibly converted) file, null otherwise</returns>
|
||||
public static XmlReader GetXmlTextReader(string filename)
|
||||
{
|
||||
Globals.Logger.Verbose("Attempting to read file: \"" + filename + "\"");
|
||||
Globals.Logger.Verbose("Attempting to read file: {0}", filename);
|
||||
|
||||
// Check if file exists
|
||||
if (!File.Exists(filename))
|
||||
{
|
||||
Globals.Logger.Warning("File '" + filename + "' could not read from!");
|
||||
Globals.Logger.Warning("File '{0}' could not read from!", filename);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user