mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Logging overhaul!
This change brings about a few changes: 1) A new LogLevel called "User" that is used for non-verbose, non-error output 2) Only User and Error are output to console now, not all of them 3) All programs have log to file enabled by default and all flags for enabling logging have been removed 4) Some former Verbose statements have been converted over to User because of the shift in usage.
This commit is contained in:
@@ -100,7 +100,7 @@ namespace SabreTools
|
||||
name += " (merged)";
|
||||
|
||||
// For good measure, get all sources
|
||||
Dictionary<int, string> sources = new Dictionary<int, string>();
|
||||
Dictionary<int, string> sources = new Dictionary<int, string>();C:\Users\Matt\GitHub\DATabase\DATabaseTwo\Generate.cs
|
||||
sources.Add(0, "Default");
|
||||
|
||||
string squery = "SELECT id, name FROM source";
|
||||
@@ -171,7 +171,7 @@ namespace SabreTools
|
||||
}
|
||||
|
||||
// Now process all of the roms
|
||||
_logger.Log("Cleaning rom data");
|
||||
_logger.User("Cleaning rom data");
|
||||
List<string> keys = roms.Keys.ToList();
|
||||
foreach (string key in keys)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace SabreTools
|
||||
/// <returns>True if the data could be inserted or updated correctly, false otherwise</returns>
|
||||
public bool ImportData()
|
||||
{
|
||||
_logger.Log("Beginning import/update process");
|
||||
_logger.User("Beginning import/update process");
|
||||
using (SqliteConnection dbc = new SqliteConnection(_connectionString))
|
||||
{
|
||||
dbc.Open();
|
||||
@@ -88,7 +88,7 @@ namespace SabreTools
|
||||
string system = _datroot + Path.DirectorySeparatorChar + sldr.GetString(1) + " - " + sldr.GetString(2);
|
||||
system = system.Trim();
|
||||
|
||||
_logger.Log("System: " + system.Remove(0, 5));
|
||||
_logger.User("System: " + system.Remove(0, 5));
|
||||
|
||||
// Audit all DATs in the folder
|
||||
foreach (string file in Directory.GetFiles(system, "*", SearchOption.AllDirectories))
|
||||
@@ -246,7 +246,7 @@ VALUES (" + hashid + ", 'source', '" + sourceid + @"'),
|
||||
}
|
||||
}
|
||||
|
||||
_logger.Log("Import/update process complete!");
|
||||
_logger.User("Import/update process complete!");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user