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:
Matt Nadareski
2016-05-10 15:41:33 -07:00
parent 37253b8c91
commit 1800ac6750
12 changed files with 80 additions and 85 deletions

View File

@@ -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;
}