Use Postgresql, add db run params, npgsql logging adapter and empty models
This commit is contained in:
parent
3425896c0b
commit
d2f31d0730
24 changed files with 252 additions and 39 deletions
|
@ -49,6 +49,16 @@ namespace Geekbot.net.Lib.Logger
|
|||
else _logger.Error(stackTrace, CreateLogString("Error", source, message, stackTrace, extra));
|
||||
}
|
||||
|
||||
public NLog.Logger GetNLogger()
|
||||
{
|
||||
return _logger;
|
||||
}
|
||||
|
||||
public bool LogAsJson()
|
||||
{
|
||||
return _logAsJson;
|
||||
}
|
||||
|
||||
private string CreateLogString(string type, LogSource source, string message, Exception stackTrace = null, object extra = null)
|
||||
{
|
||||
if (_logAsJson)
|
||||
|
|
|
@ -9,5 +9,7 @@ namespace Geekbot.net.Lib.Logger
|
|||
void Information(LogSource source, string message, object extra = null);
|
||||
void Warning(LogSource source, string message, Exception stackTrace = null, object extra = null);
|
||||
void Error(LogSource source, string message, Exception stackTrace, object extra = null);
|
||||
NLog.Logger GetNLogger();
|
||||
bool LogAsJson();
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ namespace Geekbot.net.Lib.Logger
|
|||
Gateway,
|
||||
Discord,
|
||||
Redis,
|
||||
Database,
|
||||
Message,
|
||||
UserRepository,
|
||||
Command,
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace Geekbot.net.Lib.Logger
|
|||
{
|
||||
var minLevel = runParameters.Verbose ? LogLevel.Trace : LogLevel.Info;
|
||||
config.LoggingRules.Add(
|
||||
new LoggingRule("*", LogLevel.Info, LogLevel.Fatal,
|
||||
new LoggingRule("*", minLevel, LogLevel.Fatal,
|
||||
new ColoredConsoleTarget
|
||||
{
|
||||
Name = "Console",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue