Added logging shortcuts, simplied log messages

This commit is contained in:
RogueException
2015-12-11 09:07:03 -04:00
parent 910b4c4c3d
commit 7986b819ee
9 changed files with 79 additions and 94 deletions

View File

@@ -82,7 +82,7 @@ namespace Discord.Audio
}
catch (Exception ex)
{
_gatewaySocket.Logger.Log(LogSeverity.Error, $"Error handling {e.Type} event", ex);
_gatewaySocket.Logger.Error($"Error handling {e.Type} event", ex);
}
};
}

View File

@@ -84,7 +84,7 @@ namespace Discord.Net.WebSockets
catch (OperationCanceledException) { throw; }
catch (Exception ex)
{
_logger.Log(LogSeverity.Error, "Reconnect failed", ex);
_logger.Error("Reconnect failed", ex);
//Net is down? We can keep trying to reconnect until the user runs Disconnect()
await Task.Delay(_config.FailedReconnectDelay, cancelToken).ConfigureAwait(false);
}
@@ -362,7 +362,7 @@ namespace Discord.Net.WebSockets
}
catch (SocketException ex)
{
_logger.Log(LogSeverity.Error, "Failed to send UDP packet.", ex);
_logger.Error("Failed to send UDP packet.", ex);
}
hasFrame = false;
}
@@ -469,7 +469,7 @@ namespace Discord.Net.WebSockets
break;
default:
if (_logger.Level >= LogSeverity.Warning)
_logger.Log(LogSeverity.Warning, $"Unknown Opcode: {opCode}");
_logger.Warning($"Unknown Opcode: {opCode}");
break;
}
}

View File

@@ -1,8 +1,4 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace Discord.Audio.Opus
namespace Discord.Audio.Opus
{
internal enum OpusCtl : int
{