mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 16:29:41 +02:00
Fixed: Generic SignalR messages no longer treated as errors
This commit is contained in:
parent
4b7ee3cb9e
commit
918fcac2aa
@ -31,7 +31,7 @@ private static void HandleAppDomainException(object sender, UnhandledExceptionEv
|
||||
if (exception is NullReferenceException &&
|
||||
exception.ToString().Contains("Microsoft.AspNet.SignalR.Transports.TransportHeartbeat.ProcessServerCommand"))
|
||||
{
|
||||
Logger.Warn("SignalR Heartbeat error.");
|
||||
Logger.Warn("SignalR Heartbeat interupted");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -32,19 +32,39 @@ public override void Write(char[] buffer)
|
||||
|
||||
public override void Write(string value)
|
||||
{
|
||||
if (value.ToLower().Contains("error") && !(value.ToLower().Contains("sqlite") || value.ToLower().Contains("\"errors\":null")))
|
||||
{
|
||||
_logger.Error(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
_logger.Trace(value);
|
||||
}
|
||||
_logger.Log(GetLogLevel(value), value);
|
||||
}
|
||||
|
||||
public override void Write(char value)
|
||||
{
|
||||
_logger.Trace(value);
|
||||
}
|
||||
|
||||
private LogLevel GetLogLevel(string value)
|
||||
{
|
||||
var lower = value;
|
||||
|
||||
if (!lower.Contains("error"))
|
||||
{
|
||||
return LogLevel.Trace;
|
||||
}
|
||||
|
||||
if (lower.Contains("sqlite"))
|
||||
{
|
||||
return LogLevel.Trace;
|
||||
}
|
||||
|
||||
if (lower.Contains("\"errors\":null"))
|
||||
{
|
||||
return LogLevel.Trace;
|
||||
}
|
||||
|
||||
if (lower.Contains("signalr") && lower.Contains("an operation was attempted on a nonexistent network connection"))
|
||||
{
|
||||
return LogLevel.Trace;
|
||||
}
|
||||
|
||||
return LogLevel.Error;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user