Adds a queue to the SQL log and fixes some issues pointed out

This commit is contained in:
White 2015-02-26 15:37:36 +10:30
parent 0459dfca11
commit 8ff36c6709
4 changed files with 65 additions and 33 deletions

View file

@ -157,9 +157,9 @@ namespace TShockAPI
{
logPathSetupWarning =
"Could not apply the given log path / log format, defaults will be used. Exception details:\n" + ex;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(logPathSetupWarning);
Console.ForegroundColor = ConsoleColor.Gray;
ServerApi.LogWriter.PluginWriteLine(this, logPathSetupWarning, TraceLevel.Error);
// Problem with the log path or format use the default
logFilename = Path.Combine(LogPathDefault, now.ToString(LogFormatDefault) + ".log");
}
@ -197,9 +197,7 @@ namespace TShockAPI
}
catch (MySqlException ex)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(ex);
Console.ResetColor();
ServerApi.LogWriter.PluginWriteLine(this, ex.ToString(), TraceLevel.Error);
throw new Exception("MySql not setup correctly");
}
}